@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;600;700;800&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

/**
 * Design System - Game Portal
 * Système de design unifié pour tous les jeux du portail
 */

/* ============================================
   VARIABLES CSS - Design Tokens
   ============================================ */

:root {
    /* === COULEURS === */

    /* Couleurs primaires (Pop bleu) */
    --color-primary: #2b2bff;
    --color-primary-dark: #1f1fcc;
    --color-primary-light: #5a5aff;

    /* Couleurs secondaires (Pop rose) */
    --color-secondary: #ff5da2;
    --color-secondary-dark: #e63d86;
    --color-secondary-light: #ff85bd;

    /* Couleurs d'accent (Pop) */
    --color-accent-1: #2b2bff;
    --color-accent-2: #ff5da2;
    --color-accent-3: #ffd23f;
    --color-accent-4: #16c08a;

    /* Couleurs système (Pop) */
    --color-success: #16c08a;
    --color-warning: #ffd23f;
    --color-error: #ff5da2;
    --color-info: #2b2bff;

    /* Couleurs de fond (solides Pop dark) */
    --bg-primary: #17151f;
    --bg-secondary: #241f33;
    --bg-card: #241f33;
    --bg-card-hover: #2d2740;

    /* Surfaces (ex-Glassmorphism, désormais solides) */
    --glass-bg: #241f33;
    --glass-bg-strong: #2d2740;
    --glass-border: #fbf2dd;
    --glass-shadow: 4px 4px 0 #000;

    /* Texte (cream sur dark) */
    --text-primary: #fbf2dd;
    --text-secondary: #b9b3c9;
    --text-tertiary: #8e889e;
    --text-disabled: #5f5a6e;

    /* === COULEURS PLATES (ex-GRADIENTS) === */
    --gradient-primary: #2b2bff;
    --gradient-secondary: #ff5da2;
    --gradient-success: #16c08a;
    --gradient-warning: #ffd23f;
    --gradient-hero: #2b2bff;

    /* === ESPACEMENTS === */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* === RAYONS DE BORDURE === */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* === OMBRES === */
    --shadow-xs: 2px 2px 0 #000;
    --shadow-sm: 2px 2px 0 #000;
    --shadow-md: 4px 4px 0 #000;
    --shadow-lg: 4px 4px 0 #000;
    --shadow-xl: 6px 6px 0 #000;
    --shadow-glow: 4px 4px 0 #000;
    --shadow-glow-strong: 6px 6px 0 #000;

    /* === TYPOGRAPHIE === */

    /* Familles de polices */
    --font-primary: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Bricolage Grotesque', sans-serif;
    --font-mono: 'Courier New', monospace;

    /* Tailles de police */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */
    --font-size-6xl: 4rem;        /* 64px */

    /* Poids de police */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;

    /* Hauteurs de ligne */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    --line-height-loose: 2;

    /* === TRANSITIONS === */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* === Z-INDEX === */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* === DIMENSIONS === */

    /* Largeurs de conteneur */
    --container-xs: 480px;
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;

    /* Hauteurs de composants */
    --height-input: 44px;
    --height-button-sm: 36px;
    --height-button-md: 44px;
    --height-button-lg: 52px;
    --height-header: 64px;

    /* === BREAKPOINTS === */
    --breakpoint-xs: 375px;
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* ============================================
   THÈME CLAIR (Light Mode)
   ============================================ */

[data-theme="light"] {
    --bg-primary: #fdf3df;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fdf3df;

    --glass-bg: #ffffff;
    --glass-bg-strong: #ffffff;
    --glass-border: #1a1a1a;
    --glass-shadow: 4px 4px 0 #1a1a1a;

    --text-primary: #1a1a1a;
    --text-secondary: #6a6256;
    --text-tertiary: #8a8275;
    --text-disabled: #b3ac9e;

    --shadow-xs: 2px 2px 0 #1a1a1a;
    --shadow-sm: 2px 2px 0 #1a1a1a;
    --shadow-md: 4px 4px 0 #1a1a1a;
    --shadow-lg: 4px 4px 0 #1a1a1a;
    --shadow-xl: 6px 6px 0 #1a1a1a;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-lg);
}

/* Flexbox utilities */
.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-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing utilities */
.m-auto { margin: auto; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extrabold { font-weight: var(--font-weight-extrabold); }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* Width utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Height utilities */
.h-full { height: 100%; }
.h-screen { height: 100vh; }

/* Responsive utilities */
@media (max-width: 768px) {
    .md\:hidden { display: none; }
}

@media (min-width: 769px) {
    .md\:block { display: block; }
    .md\:flex { display: flex; }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-base);
}

.animate-slide-up {
    animation: slideUp var(--transition-base);
}

.animate-slide-down {
    animation: slideDown var(--transition-base);
}

.animate-scale-in {
    animation: scaleIn var(--transition-base);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible pour les utilisateurs au clavier */
*:focus-visible {
    outline: 3px solid var(--color-accent-1);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: var(--text-primary);
        --glass-border: rgba(255, 255, 255, 0.4);
    }
}
