/* base.css — socle commun des overlays (reset, transparence, scène 1920×1080, aperçu, animations génériques) */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  -webkit-user-select: none;
  user-select: none;
}

img, svg { display: block; }
svg.ok-icon { display: inline-block; vertical-align: -0.125em; flex: none; }

/* Scène fixe 1920×1080 mise à l'échelle par OK.fitStage() */
.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  transform-origin: 0 0;
}

/* Émotes Twitch dans le chat */
.ok-emote {
  display: inline-block;
  height: 1.6em;
  width: auto;
  max-width: 4.5em;
  vertical-align: middle;
  margin: -0.35em 0.06em -0.25em;
  object-fit: contain;
}

/* ------------------------------------------------------------------
 * Animations génériques utilisées par OK.rotate() (surchargeables par thème)
 * Durée via la variable --ok-dur posée par le kit.
 * ------------------------------------------------------------------ */
@keyframes ok-in {
  from { opacity: 0; transform: translateY(0.45em); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes ok-out {
  from { opacity: 1; transform: none; filter: none; }
  to   { opacity: 0; transform: translateY(-0.45em); filter: blur(3px); }
}
@keyframes ok-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ok-fade-out { from { opacity: 1; } to { opacity: 0; } }

.ok-in  { animation: ok-in  var(--ok-dur, 450ms) cubic-bezier(.2, .7, .2, 1) both; }
.ok-out { animation: ok-out var(--ok-dur, 450ms) cubic-bezier(.7, 0, .8, .3) both; }

/* ------------------------------------------------------------------
 * Aperçu navigateur (?preview=1) : faux décor de jeu assombri, uniquement en CSS.
 * Permet de juger les overlays transparents hors d'OBS.
 * ------------------------------------------------------------------ */
html.ok-preview {
  /* Copie pour le site : décor de jeu original de l'atelier (img/decor-jeu.webp) au lieu du décor en CSS. */
  background: #10131a url(../../img/decor-jeu.webp) center / cover no-repeat;
}
html.ok-preview body { background: transparent; }

/* Aperçu du site sur téléphone (?embed=1, scène réduite par zoom dans OK.fitStage) : aucun agrandissement
   automatique du texte par le navigateur. */
html.ok-embed { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Repères de zones sûres (?grid=1) */
.ok-guides { position: fixed; inset: 0; pointer-events: none; z-index: 2147483647; }
.ok-guides i { position: absolute; display: block; }
.ok-guides-action { inset: 3.5%; outline: 1px dashed rgba(0, 255, 200, .55); }
.ok-guides-title  { inset: 5% 10%; outline: 1px dashed rgba(255, 220, 0, .55); }
.ok-guides-cross {
  inset: 0;
  background:
    linear-gradient(rgba(255, 0, 140, .45), rgba(255, 0, 140, .45)) 50% 50% / 1px 100% no-repeat,
    linear-gradient(rgba(255, 0, 140, .45), rgba(255, 0, 140, .45)) 50% 50% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 10%);
}

/* Mouvements réduits : on adoucit (fondus au lieu de déplacements, boucles ralenties) */
@media (prefers-reduced-motion: reduce) {
  .ok-in  { animation-name: ok-fade-in; }
  .ok-out { animation-name: ok-fade-out; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .2s !important;
  }
}
