/*
  Projet : Site 15A
  Fichier : css/index.css
  Version : 0.4.2 — 2026-07-05
  Objectif : Styles de la page d'accueil. Fonds servis en WebP via image-set()
             avec repli sur les originaux (JPG/PNG) pour les navigateurs sans
             support WebP. Nettoyage senior : CSS mort retiré, sélecteurs
             dédupliqués (valeur gagnante de la cascade conservée), sections
             réorganisées. NB : base.css (feuille commune du site) reste chargée
             avant cette feuille — elle fournit encore des règles utiles à
             l'accueil (taille des balles de nav en grand écran, etc.).
             Aucun changement de rendu visuel.
*/

/* ============================================================
   1. BASE GLOBALE
   ============================================================ */
body {
  margin: 0;
  font-family: "montserrat";
}

/* Les <picture> (repli WebP) ne doivent pas modifier la mise en page :
   display:contents fait de l'<img> l'élément de flux direct, comme avant. */
picture {
  display: contents;
}
/* Les attributs width/height (anti-décalage) fixent le ratio ; height:auto
   laisse la hauteur se recalculer depuis la largeur pilotée par le CSS,
   sans déformer l'image. */
picture img {
  height: auto;
}

.text-orange {
  color: #de6111;
}

/* Fond plein écran fixe (servi en WebP avec repli JPEG). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('../images/index/Fondbase-club-15A(orange)xl.jpg') center / cover no-repeat;
  background-image: image-set(
    url('../images/index/Fondbase-club-15A(orange)xl.webp') type('image/webp'),
    url('../images/index/Fondbase-club-15A(orange)xl.jpg') type('image/jpeg')
  );
  z-index: -1;
  transform: translateZ(0);
}

/* ============================================================
   2. STRUCTURE DES SECTIONS
   ============================================================ */
.section-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}
.section-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.first-section {
  margin-top: 100vh;
}

/* Bloc image (fond orange, servi en WebP avec repli PNG). */
.container-left {
  background-image: url('../images/index/JonasFondportablE5.0(orange).png');
  background-image: image-set(
    url('../images/index/JonasFondportablE5.0(orange).webp') type('image/webp'),
    url('../images/index/JonasFondportablE5.0(orange).png') type('image/png')
  );
  background-size: cover;
  background-position: 50% 20%;
  padding: 20rem 1rem;
  margin: 0;
  gap: 5rem;
}

/* Images de section (avec leur survol agrandissant côté desktop). */
.img-section,
.img-tableau,
.img-card {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.img-section img,
.img-tableau img {
  transition: transform 0.3s ease;
}

/* Contenu additionnel (masqué en mobile, grille en desktop). */
.additional-content {
  display: none;
}
.user-item {
  perspective: 1000px;
  position: relative;
}

/* ============================================================
   3. HERO (page d'accueil)
   ============================================================ */
.hero_index {
  background-image: url('../images/index/header3.0(orange).jpg');
  background-image: image-set(
    url('../images/index/header3.0(orange).webp') type('image/webp'),
    url('../images/index/header3.0(orange).jpg') type('image/jpeg')
  );
  background-size: cover;
  background-repeat: no-repeat;
  height: 125vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  text-align: center;
}
.hero-content_index {
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  gap: 3rem;
}
.hero-title_index {
  font-size: 2rem;
  margin-bottom: 1rem;
  padding: 2px 0rem;
}
.hero-image_index {
  width: 50%;
}
.hero-list_index {
  font-family: "nulshock";
  list-style-type: none;
  text-align: center;
  font-size: 13px;
  margin-top: 0;
  padding: 0;
}
.hero-container.container,
.hero-container_index.container {
  gap: 0;
}
.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.hero-container a {
  text-decoration: none;
  display: flex;
  justify-content: center;
}

/* Repli iOS : empilement vertical forcé du hero. */
@supports (-webkit-touch-callout: none) {
  .hero-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  .hero-container a {
    width: 100%;
  }
}

/* Listes hero (page d'accueil hors _index, conservées). */
.hero-list {
  list-style-type: none;
  text-align: center;
  font-size: 0.8rem;
  margin-top: 0;
  padding: 0;
}
.hero-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  padding: 2px 0rem;
}

/* ============================================================
   4. BADGES STORES (effet verre)
   ============================================================ */
.dashboard-item2 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  width: 90%;
  max-width: 300px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.glass {
  border: 1px solid #ffffff33;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.61), rgb(255 255 255 / 27%));
  backdrop-filter: blur(3px);
  position: relative;
  top: 3px;
  bottom: 1rem;
  box-shadow: rgba(0, 0, 0, 0.404) 6px 6px 12px;
  transition: transform 0.3sease;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 20px;
}
/* Effet d'agrandissement au survol des badges de stores (doublon inoffensif
   de la même règle de base.css ; conservé ici pour la lisibilité de l'accueil). */
.glass:hover {
  transform: scale(1.3);
  z-index: 4;
}
.glass p {
  color: #013cb2;
  font-weight: 700;
}
.glass span {
  color: #013cb2;
  font-weight: 900;
}

/* ============================================================
   5. BOUTONS DE DÉFILEMENT
   ============================================================ */
.scroll-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1111111;
}
.scroll-buttons button {
  background-color: #de6111;
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
}
.scroll-buttons button i {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.scroll-buttons button:hover {
  background-color: #de601199;
  transform: scale(1.1);
}
/* Fondu à l'apparition/disparition (voir base.css pour l'explication et la
   classe .is-hidden — index.html charge base.css, cette classe est donc déjà
   disponible ici). */

/* Sur ordinateur : à l'horizontale, décalés de la colonne de menu (colonne
   de boules à droite, positionnée par base.css : right:20px, largeur 100px
   → bord gauche à 120px du bord de l'écran). Marge de 20px sous ce bord →
   right:140px. Même réglage que la FAQ (2026-07-05), posé ici à la demande
   de Cédrik pour voir le rendu sur une page à PLUSIEURS conteneurs (le
   bouton « section suivante » reste visible ici, contrairement à la FAQ qui
   n'en a qu'un seul — logique gérée par js/nav.js).
   En dessous de 992px : pas de colonne de menu à cet endroit (menu mobile),
   position d'origine (bas-droite au ras du bord, empilés) inchangée. */
@media (min-width: 992px) {
  .scroll-buttons {
    right: 140px;
    flex-direction: row;
  }
}

/* ============================================================
   6. CLASSEMENT ELO (visuel + animations)
   ============================================================ */
#elo-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
}
#elo-container img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  transition: opacity 1s ease-in-out;
  filter: drop-shadow(0 0 51px #000);
}
#elo-container img.visible {
  opacity: 1;
}
#elo-container .level {
  font-family: 'Nulshock', sans-serif;
  font-size: 4rem;
  color: #fff;
  position: absolute;
  text-shadow: rgb(0, 0, 0) 8px 8px 12px;
  margin-top: 10%;
}
#elo-container .number {
  font-family: 'Nulshock', sans-serif;
  font-size: 2rem;
  color: #fff;
  position: absolute;
  text-shadow: rgb(0, 0, 0) -5px 5px 12px;
  margin-left: 30%;
}
#elo-container .level-10-shadow {
  filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.8));
  animation: glow 1.5s infinite alternate ease-in-out;
}
@keyframes glow {
  0% {
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 60px rgba(255, 215, 0, 1));
  }
}
@keyframes shine {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* ============================================================
   7. VIDÉO CLASSEMENT (cadre iPhone)
   ============================================================ */
.iphone {
  width: 295px;
  height: 565px;
  position: relative;
  overflow: hidden;
  margin: auto;
}
.iphone::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/index/3-Portable_fond_vide.png');
  background-image: image-set(
    url('../images/index/3-Portable_fond_vide.webp') type('image/webp'),
    url('../images/index/3-Portable_fond_vide.png') type('image/png')
  );
  background-size: cover;
  background-position: center;
  z-index: 2;
  pointer-events: none;
}
.page.video {
  width: 78%;
  height: 84%;
  position: absolute;
  top: 46px;
  left: 33px;
  border-radius: 20px;
  overflow: hidden;
  z-index: 1;
}
.page.video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

/* ============================================================
   8. FEATURES (pictos orange / blanc)
   ============================================================ */
.feature-orange {
  width: 50%;
  display: block;
  margin: 0 auto;
}
.feature-blanc {
  width: 50%;
  top: 0;
  left: 0;
  position: relative;
}

/* ============================================================
   9. MEDIA QUERIES
   ============================================================ */
@media (min-width: 576px) {
  .feature-orange {
    width: 20%;
  }
  .feature-blanc {
    width: 30%;
  }

  /* Hero */
  .hero-image_index {
    width: 275px;
  }
  .hero-list {
    list-style-type: none;
    text-align: left;
    font-size: 0.8rem;
    margin-top: 0;
    padding: 0;
  }
  .hero-list_index {
    font-size: 1rem;
  }

  /* Elo */
  #elo-container .level {
    font-size: 8rem;
  }
  #elo-container .number {
    font-size: 4rem;
  }

  .img-section img {
    width: 570px !important;
  }
}

@media (orientation: landscape) {
  .first-section {
    margin-top: 18rem;
  }
  .hero {
    height: 150vh;
  }
  .hero-image {
    width: 27rem;
  }
}

@media (min-width: 768px) {
  .feature-orange {
    margin-right: 0;
    width: 130px;
    margin-bottom: -15px;
  }
  .feature-blanc {
    top: -73px;
    width: 115px;
    left: -25px;
    position: absolute;
  }

  /* Fond principal (servi en WebP avec repli JPEG). */
  .main-background {
    background-image: url('../images/index/Fondbase-club-15A(orange).jpg');
    background-image: image-set(
      url('../images/index/Fondbase-club-15A(orange).webp') type('image/webp'),
      url('../images/index/Fondbase-club-15A(orange).jpg') type('image/jpeg')
    );
    background-size: 100%;
    background-attachment: fixed;
  }

  /* Hero */
  .hero {
    height: 150vh;
    width: 100%;
  }
  .hero_index {
    height: 150vh;
    width: 100%;
  }
  .hero-title {
    font-size: 3rem;
  }
  .hero-title_index {
    font-size: 3rem;
  }
  .hero-container {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-direction: row;
  }
  .hero-image_index {
    width: 305px;
  }

  .dashboard-item2 {
    width: 11rem;
    height: 3rem;
    top: 2rem;
    left: 0;
  }

  /* Conteneurs */
  .container {
    flex-direction: row;
    gap: 1rem;
  }
  .container-left {
    background-image: url('../images/index/Jonas large5.1(orange).png');
    background-image: image-set(
      url('../images/index/Jonas large5.1(orange).webp') type('image/webp'),
      url('../images/index/Jonas large5.1(orange).png') type('image/png')
    );
    flex-direction: row-reverse;
  }
  .container-left .section-title {
    flex-direction: row-reverse;
    gap: 1rem;
  }
  .container-left .text-content {
    text-align: right;
    font-weight: 600;
  }
  .container-left h2 {
    text-align: end;
  }
  .container > div {
    flex: 1 1 50%;
    margin-bottom: 5rem;
    position: relative;
    bottom: 3rem;
  }
  .text-content {
    text-align: left;
    font-weight: 600;
  }

  .first-section {
    margin-top: 100vh;
  }
  .section-title {
    flex-direction: row;
    gap: 1rem;
    text-align: left;
  }
  .section-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .img-tableau {
    display: none;
  }
  .img-section img {
    width: 415px !important;
  }
  .img-section:hover img,
  .img-tableau:hover img {
    transform: scale(1.3);
    z-index: 4;
  }

  .additional-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .user-item1 {
    width: 8rem;
    height: 5rem;
    top: 1rem;
    left: 15rem;
  }
  .user-item2 {
    width: 8rem;
    height: 5rem;
    top: 0rem;
    left: 17rem;
  }
  .user-item3 {
    width: 8rem;
    height: 9rem;
    top: 0rem;
    left: 11rem;
  }
  .user-item4 {
    width: 15rem;
    height: 8rem;
    z-index: 3;
    left: 10rem;
  }
  .user-item5 {
    width: 7rem;
    left: 8rem;
    height: 5rem;
    top: 1rem;
  }
  .user-item6 {
    width: 8rem;
    height: 5rem;
    bottom: -1rem;
    left: 17rem;
  }
  .user-item7 {
    width: 8rem;
    height: 5rem;
    bottom: 0rem;
    left: 20rem;
  }

  .card .back a {
    font-size: 1rem;
    padding: 0.5rem;
  }

  #elo-container .level {
    font-size: 5rem;
  }
  #elo-container .number {
    font-size: 3rem;
  }
}

@media (min-width: 992px) {
  h2 {
    font-size: 1.5rem;
  }
  .feature-orange {
    width: 140px;
  }
  .text-content {
    font-size: 1.1rem;
  }
  .mobile-images {
    display: none;
  }
  #pc-nav {
    display: block;
  }
  .pc-images {
    position: fixed;
    top: 453px;
    padding: 0;
    right: 20px;
    transform: translateY(-50%);
    z-index: 100;
    transition: right 0.3s ease;
    gap: 0;
    display: grid;
    border-radius: 45px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .hero-image_index {
    width: 455px;
  }
  .hero-list {
    padding: 0rem;
    font-size: 1.5rem;
    margin-top: 13px;
  }
  .hero-image {
    width: 30rem;
    position: relative;
    left: 0%;
  }
  .hero-list_index {
    font-size: 1.5rem;
  }

  #elo-container {
    width: 55%;
  }
  #elo-container .level {
    font-size: 6rem;
  }
  #elo-container .number {
    font-size: 3rem;
  }
}

@media (min-width: 1200px) {
  .feature-blanc {
    width: 130px;
  }
  .container {
    padding: 13rem 10rem;
  }
  .container > div {
    flex: 1 1 50%;
    margin-bottom: 5rem;
    position: relative;
    bottom: 1rem;
  }

  .hero-title_index {
    font-size: 2.5rem;
  }
  .gif-scroll {
    width: 195px !important;
  }
  h2 {
    font-size: 1.75rem;
  }
  .text-content {
    font-size: 1.2rem;
  }

  #elo-container .level {
    font-size: 5rem;
  }
  #elo-container .number {
    font-size: 2rem;
  }
}

@media (min-width: 1400px) {
  h2 {
    font-size: 3rem;
  }
  .text-content {
    font-size: 1.3rem;
    line-height: 2rem;
    font-weight: 600;
  }
  .picto {
    width: 6rem;
  }
  .container {
    padding: 0 15rem;
  }

  .dashboard-item2 {
    width: 12rem;
  }
  .user-item1 {
    width: 14rem;
    height: 8rem;
    top: -1rem;
    left: 28rem;
  }
  .user-item2 {
    width: 14rem;
    height: 9rem;
    top: 2rem;
    left: 30rem;
  }
  .user-item3 {
    width: 11rem;
    height: 9rem;
    left: 16rem;
    top: -6rem;
  }
  .user-item4 {
    width: 25rem;
    height: 13rem;
    left: 12rem;
    z-index: 3;
  }
  .user-item5 {
    width: 11rem;
    height: 9rem;
    top: 13rem;
    left: 9rem;
  }
  .user-item6 {
    width: 14rem;
    height: 10rem;
    bottom: 7rem;
    left: 15rem;
  }
  .user-item7 {
    width: 14rem;
    height: 9rem;
    bottom: 0rem;
    left: 15rem;
  }

  /* Classement Elo */
  .classement-etoile {
    width: 430px !important;
  }

  /* Vidéo classement (grand cadre iPhone) */
  .iphone {
    width: 500px;
    height: 815px;
    position: relative;
    overflow: hidden;
    margin: auto;
  }
  .iphone::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/index/3-Portable_fond_vide.png');
    background-size: cover;
    background-position: center;
    z-index: 2;
    pointer-events: none;
  }
  .page.video {
    width: 70%;
    height: 88%;
    position: absolute;
    top: 50px;
    left: 72px;
    border-radius: 20px;
    overflow: hidden;
    z-index: 1;
  }
  .page.video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
  }
}

@media (min-width: 1700px) {
  .pc-images {
    top: 453px;
  }
  #elo-container {
    width: 40%;
  }
}

/* --- Titre latéral vertical (bande gauche) — aligné à l'identique sur le
       système des autres pages (Elo, Terrain autonome, Tournois, Actualité).
       L'image PNG dédiée (bande sombre + nom vertical texturé) porte tout le
       visuel ; ce CSS ne fait que la fixer en haut à gauche. Masquée sous
       992px (mobile + tablette), exactement comme ailleurs. --- */
.tournois-titre-gauche {
  display: none;
}

@media (min-width: 992px) {
  .tournois-titre-gauche {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 6rem;
    height: auto; /* évite un piège navigateur : avec les attributs HTML
                     width/height sur une image en position fixe, la hauteur
                     resterait figée à la valeur brute de l'attribut au lieu
                     de suivre la largeur — cf. docs/ERRORS_AND_TESTS_LOG.md
                     (v0.18.1) */
    z-index: 1;
  }
}
