/* ==========================================================================
   Jeux-en-ligne — feuille de style commune (catalogue + lanceur)
   Pensée mobile d'abord. Couleurs définies en variables, thème sombre automatique.
   ========================================================================== */

:root {
  --fond: #fff7ea;
  --fond-2: #ffefd6;
  --carte: #ffffff;
  --encre: #2a2140;
  --encre-douce: #6b6180;
  --trait: #eadfcb;
  --accent: #ff5d3b;        /* corail : actions principales */
  --accent-encre: #ffffff;
  --accent-2: #13a39a;      /* turquoise : étiquettes, focus */
  --jaune: #ffc93c;         /* badge « Nouveau » */
  --ombre: 0 2px 0 rgba(42, 33, 64, .08), 0 8px 24px -12px rgba(42, 33, 64, .25);
  --rayon: 18px;
  --police: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #17131f;
    --fond-2: #211b2c;
    --carte: #262033;
    --encre: #f6efe4;
    --encre-douce: #b4aac4;
    --trait: #3a3249;
    --accent: #ff7254;
    --accent-2: #3cc8bd;
    --jaune: #ffd25e;
    --ombre: 0 2px 0 rgba(0, 0, 0, .25), 0 10px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 8px;
}

.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;
}

/* --------------------------------------------------------------------------
   En-tête du catalogue
   -------------------------------------------------------------------------- */

.entete {
  padding: 20px 16px 8px;
  max-width: 1200px;
  margin: 0 auto;
}

.marque {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: clamp(26px, 6vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.marque-logo {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.marque small {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--encre-douce);
  margin-top: 4px;
}

.recherche {
  position: relative;
}

.recherche svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--encre-douce);
  pointer-events: none;
}

.recherche input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 44px;
  border: 2px solid var(--trait);
  border-radius: 999px;
  background: var(--carte);
  color: var(--encre);
  font: inherit;
  font-size: 17px;
}

.recherche input:focus {
  outline: none;
  border-color: var(--accent-2);
}

/* --------------------------------------------------------------------------
   Onglets et filtres
   -------------------------------------------------------------------------- */

.barre-filtres {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--fond);
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--trait);
}

.barre-filtres-int {
  max-width: 1200px;
  margin: 0 auto;
}

.onglets,
.etiquettes {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}

.onglets::-webkit-scrollbar,
.etiquettes::-webkit-scrollbar { display: none; }

.etiquettes { margin-top: 8px; }

.onglet,
.puce {
  flex: none;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--trait);
  border-radius: 999px;
  background: var(--carte);
  color: var(--encre);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.puce {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--encre-douce);
}

.onglet[aria-selected="true"] {
  background: var(--encre);
  border-color: var(--encre);
  color: var(--fond);
}

.puce[aria-pressed="true"] {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Grille de jaquettes
   -------------------------------------------------------------------------- */

main.catalogue {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.compte {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--encre-douce);
  font-weight: 600;
}

.grille {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px)  { .grille { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 900px)  { .grille { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1150px) { .grille { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.carte {
  display: block;
  height: 100%;
  text-decoration: none;
  background: var(--carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}

.carte:hover { transform: translateY(-3px); }
.carte:active { transform: scale(.97); }

.jaquette {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--fond-2);
}

.jaquette img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-nouveau {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 3px 10px;
  box-shadow: 0 2px 6px rgba(42, 33, 64, .25);
  border-radius: 999px;
  background: var(--jaune);
  color: #2a2140;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.carte-texte {
  padding: 10px 12px 12px;
}

.carte-titre {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.carte-infos {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--encre-douce);
}

.vide {
  text-align: center;
  padding: 48px 16px;
  color: var(--encre-douce);
}

.vide strong {
  display: block;
  font-size: 20px;
  color: var(--encre);
  margin-bottom: 6px;
}

.pied {
  text-align: center;
  font-size: 13px;
  color: var(--encre-douce);
  padding: 0 16px 32px;
}

/* --------------------------------------------------------------------------
   Lanceur de jeu (play.html)
   -------------------------------------------------------------------------- */

body.lanceur {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #000;
}

.barre-jeu {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 8px;
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: var(--encre);
  color: var(--fond);
}

.barre-jeu h1 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bouton-rond {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.bouton-rond:hover { background: rgba(255, 255, 255, .2); }
.bouton-rond svg { width: 22px; height: 22px; }

@media (prefers-color-scheme: dark) {
  .barre-jeu { background: #0d0a12; color: #f6efe4; }
}

.scene {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}

.scene iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.scene:fullscreen iframe { height: 100vh; }

.message-jeu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: var(--fond);
  color: var(--encre);
}

.message-jeu[hidden] { display: none; }

.bouton {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-encre);
  font-weight: 800;
  text-decoration: none;
}
