/* ============================================================
   YouCare Game — Design System
   Charte : fond sombre violet, accents blanc et néon violet.
   Utilisé sur : landing, admin, chrome des jeux (header/footer, modales, leaderboard, formulaires).
   Les zones de gameplay peuvent avoir leur propre palette.
   ============================================================ */

/* -------- Variables -------- */
:root {
  /* Palette principale */
  --yc-bg-deep: #1a1033;
  --yc-bg-mid: #2d1b5e;
  --yc-bg-light: #3d2478;
  --yc-violet: #7c4dff;
  --yc-violet-light: #b388ff;
  --yc-violet-glow: #9d6cff;
  --yc-white: #ffffff;
  --yc-white-soft: rgba(255, 255, 255, 0.87);
  --yc-white-dim: rgba(255, 255, 255, 0.6);
  --yc-white-faint: rgba(255, 255, 255, 0.12);

  /* États */
  --yc-success: #4caf50;
  --yc-warning: #ffb300;
  --yc-error: #ff5252;

  /* Typo */
  --yc-font-sans: 'Inter', 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --yc-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Espacement */
  --yc-sp-1: 0.25rem;
  --yc-sp-2: 0.5rem;
  --yc-sp-3: 0.75rem;
  --yc-sp-4: 1rem;
  --yc-sp-6: 1.5rem;
  --yc-sp-8: 2rem;
  --yc-sp-12: 3rem;
  --yc-sp-16: 4rem;

  /* Rayons */
  --yc-radius-sm: 6px;
  --yc-radius-md: 10px;
  --yc-radius-lg: 16px;
  --yc-radius-pill: 999px;

  /* Ombres */
  --yc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --yc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --yc-shadow-glow: 0 0 24px rgba(124, 77, 255, 0.4);

  /* Transitions */
  --yc-transition: 180ms ease;

  /* Layout */
  --yc-maxw-content: 72rem;
  --yc-maxw-prose: 42rem;
}

/* -------- Reset minimal -------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--yc-font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--yc-white-soft);
  background: var(--yc-bg-deep);
  background-image:
    radial-gradient(ellipse at top left, rgba(124, 77, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(179, 136, 255, 0.1) 0%, transparent 50%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

/* -------- Focus visible (a11y) -------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--yc-violet-light);
  outline-offset: 2px;
  border-radius: var(--yc-radius-sm);
}

/* -------- Liens -------- */
a {
  color: var(--yc-violet-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--yc-transition);
}
a:hover { color: var(--yc-white); }

/* -------- Titres -------- */
h1, h2, h3, h4 {
  margin: 0 0 var(--yc-sp-4);
  font-weight: 700;
  line-height: 1.2;
  color: var(--yc-white);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }

.yc-gradient-text {
  background: linear-gradient(90deg, var(--yc-violet), var(--yc-violet-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* -------- Layout -------- */
.yc-container {
  width: 100%;
  max-width: var(--yc-maxw-content);
  margin: 0 auto;
  padding: 0 var(--yc-sp-6);
}
.yc-prose { max-width: var(--yc-maxw-prose); }

/* -------- Header -------- */
.yc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--yc-sp-4) var(--yc-sp-6);
  border-bottom: 1px solid var(--yc-white-faint);
  background: rgba(26, 16, 51, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.yc-brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--yc-white);
}

/* -------- Boutons -------- */
.yc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--yc-sp-2);
  padding: var(--yc-sp-3) var(--yc-sp-6);
  border: none;
  border-radius: var(--yc-radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--yc-transition), box-shadow var(--yc-transition), background var(--yc-transition);
  min-height: 44px; /* a11y cible tactile */
}
.yc-btn--primary {
  background: linear-gradient(135deg, var(--yc-violet), var(--yc-violet-glow));
  color: var(--yc-white);
  box-shadow: var(--yc-shadow-glow);
}
.yc-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124, 77, 255, 0.5); }
.yc-btn--secondary {
  background: var(--yc-white-faint);
  color: var(--yc-white);
}
.yc-btn--secondary:hover { background: rgba(255, 255, 255, 0.2); }
.yc-btn--ghost {
  background: transparent;
  color: var(--yc-white-soft);
  border: 1px solid var(--yc-white-faint);
}
.yc-btn--ghost:hover { border-color: var(--yc-violet-light); color: var(--yc-white); }
.yc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* -------- Champs -------- */
.yc-field {
  display: flex;
  flex-direction: column;
  gap: var(--yc-sp-2);
  margin-bottom: var(--yc-sp-4);
}
.yc-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--yc-white-soft);
}
.yc-input {
  width: 100%;
  padding: var(--yc-sp-3) var(--yc-sp-4);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--yc-white-faint);
  border-radius: var(--yc-radius-md);
  color: var(--yc-white);
  transition: border-color var(--yc-transition), background var(--yc-transition);
  min-height: 44px;
}
.yc-input:focus-visible {
  border-color: var(--yc-violet-light);
  background: rgba(0, 0, 0, 0.4);
  outline: none;
}
.yc-input::placeholder { color: var(--yc-white-dim); }

/* Honeypot : champ caché pour piéger les bots */
.yc-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  tab-index: -1;
}

/* -------- Cartes -------- */
.yc-card {
  background: rgba(45, 27, 94, 0.4);
  border: 1px solid var(--yc-white-faint);
  border-radius: var(--yc-radius-lg);
  padding: var(--yc-sp-8);
  backdrop-filter: blur(8px);
}

/* -------- Modale -------- */
.yc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--yc-sp-4);
  z-index: 100;
  animation: yc-fade-in 200ms ease;
}
.yc-modal {
  background: var(--yc-bg-mid);
  border: 1px solid var(--yc-white-faint);
  border-radius: var(--yc-radius-lg);
  padding: var(--yc-sp-8);
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--yc-shadow-md);
}

/* -------- Footer -------- */
.yc-footer {
  padding: var(--yc-sp-12) var(--yc-sp-6) var(--yc-sp-8);
  border-top: 1px solid var(--yc-white-faint);
  text-align: center;
  color: var(--yc-white-dim);
  font-size: 0.9rem;
}
.yc-footer a { color: var(--yc-white-dim); }
.yc-footer a:hover { color: var(--yc-violet-light); }
.yc-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--yc-sp-4);
  margin-bottom: var(--yc-sp-4);
  list-style: none;
  padding: 0;
}

/* -------- Switcher de langue -------- */
.yc-lang-switcher {
  display: inline-flex;
  gap: var(--yc-sp-1);
  background: var(--yc-white-faint);
  border-radius: var(--yc-radius-pill);
  padding: 2px;
}
.yc-lang-btn {
  background: transparent;
  color: var(--yc-white-dim);
  border: none;
  padding: var(--yc-sp-1) var(--yc-sp-3);
  border-radius: var(--yc-radius-pill);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--yc-transition);
  min-height: 32px;
  min-width: 32px;
}
.yc-lang-btn[aria-pressed="true"] {
  background: var(--yc-violet);
  color: var(--yc-white);
}

/* -------- Utilitaires -------- */
.yc-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;
}
.yc-text-center { text-align: center; }
.yc-mt-4 { margin-top: var(--yc-sp-4); }
.yc-mt-8 { margin-top: var(--yc-sp-8); }
.yc-mb-4 { margin-bottom: var(--yc-sp-4); }

/* -------- Animations -------- */
@keyframes yc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes yc-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------- Reduced motion -------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------- Mobile -------- */
@media (max-width: 480px) {
  .yc-container { padding: 0 var(--yc-sp-4); }
  .yc-card { padding: var(--yc-sp-6); }
  .yc-header { padding: var(--yc-sp-3) var(--yc-sp-4); }
}
