/**
 * DueFon Flèche — base.css
 *
 * Tokens CSS du design system §10 du brief.
 * À étendre avec components.css + screens.css au fil des paliers.
 */

:root {
  /* === Couleurs : noir cinématique « Scary Movie » === */
  --bg-deep: #07060a;        /* noir quasi absolu */
  --bg-surface: #150d11;     /* sombre teinté sang */
  --bg-raised: #1f141a;
  --bg-overlay: rgba(7, 6, 10, 0.88);
  --border: #3a2128;         /* bordure teintée sang */

  /* === Couleurs : accents (rouge sang) === */
  --accent-red: #e50914;       /* rouge sang cinéma */
  --accent-red-bright: #ff2b39;/* highlight / glow */
  --accent-red-dark: #7a0109;  /* sang foncé */
  --accent-gold: #f4c430;
  --accent-green: #2db67c;
  --accent-blue: #3b82f6;

  /* === Texte (blanc chaud) === */
  --text-primary: #f6f0f1;
  --text-secondary: #b6a8ac;
  --text-muted: #6b5a60;

  /* === Palette joueurs (8 couleurs distinctes) === */
  --p1: #e63946;
  --p2: #f4c430;
  --p3: #2db67c;
  --p4: #3b82f6;
  --p5: #8b5cf6;
  --p6: #ec4899;
  --p7: #f97316;
  --p8: #14b8a6;

  /* === Spacing (grid 8px) === */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* === Border radius === */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* === Typographie ===
   * Anton + Oswald + Inter à charger en local plus tard (assets/fonts/).
   * Pour le palier 1 démontrable : fallback system propre.
   */
  --f-display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --f-title: 'Oswald', 'Trebuchet MS', sans-serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-horror: 'Nosifer', 'Anton', 'Impact', sans-serif; /* titre « scary movie » */

  /* === Shadows + glow === */
  --sh-btn: 0 6px 28px rgba(229, 9, 20, 0.5);
  --sh-card: 0 10px 30px rgba(0, 0, 0, 0.6);
  --sh-overlay: 0 24px 70px rgba(0, 0, 0, 0.75);
  --glow-red: 0 0 22px rgba(229, 9, 20, 0.6);
  --glow-red-strong: 0 0 40px rgba(255, 43, 57, 0.7);

  /* === Safe area iOS (notch + home indicator) === */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Empêche le pull-to-refresh sur iOS pour ne pas casser le jeu */
  overscroll-behavior-y: contain;
  /* Désactive le tap-highlight bleu d'iOS sur les boutons */
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  /* Vignette cinématique : halo sang en haut + assombrissement des bords */
  background:
    radial-gradient(130% 80% at 50% -15%, rgba(229, 9, 20, 0.14), transparent 55%),
    radial-gradient(100% 100% at 50% 45%, transparent 50%, rgba(0, 0, 0, 0.6)),
    var(--bg-deep);
  background-attachment: fixed;
}

/* Grain de film (subtil) par-dessus tout, non bloquant */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
}

/* === Typographie : règles globales === */
h1,
h2,
h3 {
  font-family: var(--f-title);
  font-weight: 600;
  margin: 0;
}

button {
  font-family: var(--f-title);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Désactive le double-tap-to-zoom sur les boutons */
button,
[role='button'] {
  touch-action: manipulation;
}

/* === Skeleton de boot (avant Vue mount) === */
.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: var(--s-5);
}

.boot__mark {
  width: 120px;
  height: 120px;
  margin-bottom: var(--s-4);
  filter: drop-shadow(0 0 24px rgba(229, 9, 20, 0.5));
}

.boot__title {
  font-family: var(--f-horror);
  font-size: clamp(40px, 13vw, 60px);
  letter-spacing: 0.01em;
  color: var(--accent-red);
  text-shadow:
    0 0 18px rgba(229, 9, 20, 0.65),
    0 2px 0 var(--accent-red-dark),
    0 6px 14px rgba(0, 0, 0, 0.7);
  margin-bottom: var(--s-4);
  line-height: 1.1;
}

.boot__hint {
  font-family: var(--f-body);
  color: var(--text-muted);
  font-size: 14px;
}

/* === Accessibility : prefers-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;
  }
}
