/* =====================================================
   GREENFLAG GAMES — DESIGN SYSTEM
   CSS Custom Properties, Typography, Reset, Utilities
   greeenflaggames.com
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties ─────────────────────────── */
:root {

  /* ── Color — Brand ── */
  --color-primary:        #16A34A;
  --color-primary-light:  #22C55E;
  --color-primary-dark:   #15803D;
  --color-primary-xdark:  #14532D;
  --color-primary-50:     #F0FDF4;
  --color-primary-100:    #DCFCE7;
  --color-primary-200:    #BBF7D0;
  --color-primary-300:    #86EFAC;
  --color-primary-400:    #4ADE80;
  --color-primary-500:    #22C55E;
  --color-primary-600:    #16A34A;
  --color-primary-700:    #15803D;
  --color-primary-900:    #14532D;

  --color-secondary:      #0F172A;
  --color-secondary-light:#1E293B;

  /* ── Color — Surfaces ── */
  --color-bg:             #FFFFFF;
  --color-bg-dark:        #0B1120;
  --color-surface:        #F9FAFB;
  --color-surface-dark:   #111827;
  --color-surface-dark-2: #1A2332;
  --color-surface-dark-3: #1F2937;
  --color-border:         #E5E7EB;
  --color-border-dark:    #374151;

  /* ── Color — Neutral Gray ── */
  --color-white:          #FFFFFF;
  --color-gray-50:        #F9FAFB;
  --color-gray-100:       #F3F4F6;
  --color-gray-200:       #E5E7EB;
  --color-gray-300:       #D1D5DB;
  --color-gray-400:       #9CA3AF;
  --color-gray-500:       #6B7280;
  --color-gray-600:       #4B5563;
  --color-gray-700:       #374151;
  --color-gray-800:       #1F2937;
  --color-gray-900:       #111827;

  /* ── Color — Semantic ── */
  --color-success:        #22C55E;
  --color-success-bg:     #F0FDF4;
  --color-warning:        #F59E0B;
  --color-warning-bg:     #FFFBEB;
  --color-error:          #EF4444;
  --color-error-bg:       #FEF2F2;
  --color-info:           #3B82F6;
  --color-info-bg:        #EFF6FF;

  /* ── Color — Ticket Status ── */
  --status-open:          #3B82F6;
  --status-open-bg:       #EFF6FF;
  --status-progress:      #F59E0B;
  --status-progress-bg:   #FFFBEB;
  --status-resolved:      #22C55E;
  --status-resolved-bg:   #F0FDF4;
  --status-closed:        #6B7280;
  --status-closed-bg:     #F9FAFB;

  /* ── Color — Priority ── */
  --priority-low:         #22C55E;
  --priority-medium:      #F59E0B;
  --priority-high:        #F97316;
  --priority-urgent:      #EF4444;

  /* ── Typography ── */
  --font-family:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:      'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-lg:    1.125rem;   /* 18px */
  --text-xl:    1.25rem;    /* 20px */
  --text-2xl:   1.5rem;     /* 24px */
  --text-3xl:   1.875rem;   /* 30px */
  --text-4xl:   2.25rem;    /* 36px */
  --text-5xl:   3rem;       /* 48px */
  --text-6xl:   3.75rem;    /* 60px */
  --text-7xl:   4.5rem;     /* 72px */
  --text-8xl:   6rem;       /* 96px */

  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;
  --fw-black:     900;

  --lh-tight:     1.15;
  --lh-snug:      1.35;
  --lh-normal:    1.5;
  --lh-relaxed:   1.65;
  --lh-loose:     2;

  --ls-tight:     -0.025em;
  --ls-normal:    0;
  --ls-wide:      0.025em;
  --ls-wider:     0.05em;
  --ls-widest:    0.1em;

  /* ── Spacing ── */
  --space-1:  0.25rem;   /*  4px */
  --space-2:  0.5rem;    /*  8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-7:  1.75rem;   /* 28px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-14: 3.5rem;    /* 56px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */
  --space-40: 10rem;     /* 160px */

  /* ── Border Radius ── */
  --radius-xs:   0.125rem;  /*  2px */
  --radius-sm:   0.25rem;   /*  4px */
  --radius-md:   0.5rem;    /*  8px */
  --radius-lg:   0.75rem;   /* 12px */
  --radius-xl:   1rem;      /* 16px */
  --radius-2xl:  1.25rem;   /* 20px */
  --radius-3xl:  1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl:   0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --shadow-2xl:  0 25px 50px -12px rgba(0,0,0,0.25);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.06);

  /* Glow shadows */
  --shadow-green-sm:  0 0 12px rgba(22,163,74,0.25);
  --shadow-green-md:  0 0 24px rgba(22,163,74,0.35);
  --shadow-green-lg:  0 0 48px rgba(22,163,74,0.4);
  --shadow-green-xl:  0 8px 32px rgba(22,163,74,0.45);
  --shadow-dark:      0 25px 50px -12px rgba(0,0,0,0.5);

  /* ── Transitions ── */
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);

  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --duration-xslow:  600ms;

  --transition-fast:   var(--duration-fast) var(--ease-in-out);
  --transition-base:   var(--duration-base) var(--ease-in-out);
  --transition-slow:   var(--duration-slow) var(--ease-in-out);
  --transition-spring: var(--duration-slow) var(--ease-spring);

  /* ── Z-Index ── */
  --z-below:    -1;
  --z-base:      0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-fixed:    300;
  --z-overlay:  400;
  --z-modal:    500;
  --z-toast:    600;
  --z-cookie:   700;
  --z-top:      999;

  /* ── Layout ── */
  --nav-height:     72px;
  --container-xs:   480px;
  --container-sm:   640px;
  --container-md:   768px;
  --container-lg:   1024px;
  --container-xl:   1280px;
  --container-2xl:  1440px;

  /* ── Section Padding ── */
  --section-y: var(--space-24);
  --section-y-sm: var(--space-16);
}


/* ═══════════════════════════════════════════════════
   CSS RESET & BASE
   ═══════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-gray-900);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

p {
  line-height: var(--lh-relaxed);
}

strong { font-weight: var(--fw-semibold); }
em { font-style: italic; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background-color: var(--color-primary-200);
  color: var(--color-primary-xdark);
}


/* ═══════════════════════════════════════════════════
   TYPOGRAPHY SCALE
   ═══════════════════════════════════════════════════ */

.display-1 {
  font-size: clamp(var(--text-5xl), 8vw, var(--text-8xl));
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

.display-2 {
  font-size: clamp(var(--text-4xl), 6vw, var(--text-7xl));
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

.heading-1 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl));
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

.heading-2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-5xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
}

.heading-3 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-4xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

.heading-4 {
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-3xl));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

.heading-5 {
  font-size: clamp(var(--text-base), 2vw, var(--text-2xl));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-normal);
}

.heading-6 {
  font-size: clamp(var(--text-sm), 1.5vw, var(--text-xl));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-normal);
}

.lead {
  font-size: clamp(var(--text-lg), 2vw, var(--text-xl));
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-gray-600);
}

.body-lg { font-size: var(--text-lg); line-height: var(--lh-relaxed); }
.body-base { font-size: var(--text-base); line-height: var(--lh-relaxed); }
.body-sm { font-size: var(--text-sm); line-height: var(--lh-normal); }
.caption { font-size: var(--text-xs); font-weight: var(--fw-medium); letter-spacing: var(--ls-wide); }
.overline { font-size: var(--text-xs); font-weight: var(--fw-semibold); letter-spacing: var(--ls-widest); text-transform: uppercase; }

/* Gradient Text */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 50%, var(--color-primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-white {
  background: linear-gradient(135deg, #FFFFFF 0%, rgba(255,255,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ═══════════════════════════════════════════════════
   LAYOUT — CONTAINER & GRID
   ═══════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-2xl { max-width: var(--container-2xl); }

@media (max-width: 640px) {
  .container { padding-inline: var(--space-4); }
}

.section { padding-block: var(--section-y); }
.section-sm { padding-block: var(--section-y-sm); }

/* Grid system */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-6 { grid-template-columns: repeat(6, 1fr); gap: var(--space-6); }

/* Auto-fit grids */
.grid-auto-sm { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-6); }
.grid-auto-md { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-6); }
.grid-auto-lg { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: var(--space-8); }

/* Flex helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ═══════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════ */

/* Spacing */
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.mx-auto { margin-inline: auto; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Colors */
.text-primary { color: var(--color-primary); }
.text-primary-light { color: var(--color-primary-light); }
.text-white { color: var(--color-white); }
.text-muted { color: var(--color-gray-500); }
.text-dark { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

.bg-primary { background-color: var(--color-primary); }
.bg-dark { background-color: var(--color-bg-dark); }
.bg-surface { background-color: var(--color-surface); }
.bg-white { background-color: var(--color-white); }

/* Border */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }

/* Aspect Ratios */
.aspect-square { aspect-ratio: 1; }
.aspect-video { aspect-ratio: 16/9; }
.aspect-game-banner { aspect-ratio: 16/6; }
.aspect-game-icon { aspect-ratio: 1; }
.aspect-screenshot { aspect-ratio: 9/16; }

/* Object fit */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-center { object-position: center; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-green { box-shadow: var(--shadow-green-md); }

/* Pointer */
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; }

/* ── Section Title Block ── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-header .overline {
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  display: block;
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header .lead {
  max-width: 600px;
  margin-inline: auto;
}

/* Dark mode section header */
.section-header.dark .overline { color: var(--color-primary-light); }
.section-header.dark h2 { color: var(--color-white); }
.section-header.dark .lead { color: var(--color-gray-400); }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--color-border);
  margin-block: var(--space-8);
}

.divider-dark {
  background: var(--color-border-dark);
}

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-200) 25%,
    var(--color-gray-100) 50%,
    var(--color-gray-200) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-dark {
  background: linear-gradient(
    90deg,
    var(--color-surface-dark-3) 25%,
    var(--color-surface-dark-2) 50%,
    var(--color-surface-dark-3) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
  width: calc(100% - var(--space-8));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--color-primary);
  animation: toast-in 0.35s var(--ease-spring);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.toast.toast-success { border-color: var(--color-success); }
.toast.toast-warning { border-color: var(--color-warning); }
.toast.toast-error   { border-color: var(--color-error); }
.toast.toast-info    { border-color: var(--color-info); }

.toast.removing {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content { flex: 1; }
.toast-title { font-weight: var(--fw-semibold); font-size: var(--text-sm); color: var(--color-gray-900); }
.toast-body { font-size: var(--text-sm); color: var(--color-gray-500); margin-top: 2px; }

.toast-close {
  color: var(--color-gray-400);
  font-size: var(--text-lg);
  line-height: 1;
  flex-shrink: 0;
  padding: 0;
  transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--color-gray-700); }

/* ── Responsive Breakpoints ─────────────────────────
   Breakpoints:
   xs: 480px
   sm: 640px
   md: 768px
   lg: 1024px
   xl: 1280px
   2xl: 1440px
   ─────────────────────────────────────────────────── */

@media (max-width: 1280px) {
  :root { --section-y: var(--space-20); }
}

@media (max-width: 1024px) {
  :root { --section-y: var(--space-16); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  :root { --section-y: var(--space-12); --section-y-sm: var(--space-10); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-auto-md { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (max-width: 480px) {
  :root { --section-y: var(--space-10); }
  .grid-6 { grid-template-columns: 1fr; }
  .toast-container { bottom: var(--space-4); right: var(--space-4); }
}
