@font-face {
  font-family: "Poppins";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/poppins-600.woff2") format("woff2");
}

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

html {
  background: #000;
  color: #f2efe8;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  margin: 0;
}

/* Décor : la vidéo remplit tout l'écran (cover), quitte à rogner ses bords.
   Elle ne contient plus ni logo ni texte : ils sont posés par-dessus en HTML
   et se placent selon la taille de l'écran. */
.backdrop,
.shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.backdrop {
  object-fit: cover;
  background: #000;
}

/* Assombrissement progressif vers le bas, repris de l'overlay d'origine, et
   léger voile au centre : lisibilité du texte sur les plans clairs (brume). */
.shade {
  background:
    radial-gradient(ellipse 55% 45% at 50% 55%, rgba(0, 0, 0, 0.3), transparent 75%),
    linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.12) 0%,
    rgba(0, 0, 0, 0.04) 25%,
    rgba(0, 0, 0, 0.14) 55%,
    rgba(0, 0, 0, 0.4) 75%,
    rgba(0, 0, 0, 0.65) 92%,
    rgba(0, 0, 0, 0.78) 100%
  );
}

/* La page défile si l'écran est trop petit (téléphone à l'horizontale). */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(72px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3.5vh, 40px);
  padding-bottom: 24px;
}

h1 {
  margin: 0;
  line-height: 0;
}

.logo {
  width: clamp(150px, min(30vh, 46vw), 320px);
  height: auto;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.45));
}

/* Trailers : trois vignettes vers YouTube. */
.trailers {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.trailers h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.9);
}

.trailers ul {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.trailer {
  display: block;
  width: clamp(150px, 15vw, 230px);
  overflow: hidden;
  border: 1px solid rgba(242, 239, 232, 0.25);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: inherit;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s, border-color 0.2s;
}

.trailer:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 239, 232, 0.7);
}

.trailer:focus-visible,
.discord:focus-visible {
  outline: 2px solid #c8a04a;
  outline-offset: 3px;
}

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
}

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

/* Bouton lecture dessiné en CSS. */
.thumb::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7v10l8-5z' fill='white'/%3E%3C/svg%3E") center / 24px no-repeat,
    rgba(0, 0, 0, 0.6);
  transition: background-color 0.2s;
}

.trailer:hover .thumb::after {
  background-color: #c4302b;
}

.caption {
  display: block;
  padding: 8px 10px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(242, 239, 232, 0.8);
}

.caption strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f2efe8;
}

/* Discord : couleur officielle (#5865f2), texte blanc lisible (contraste 4,6:1). */
.discord {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #5865f2;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, transform 0.2s;
}

.discord:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

.discord img {
  width: 26px;
  height: auto;
  filter: brightness(0) invert(1);
}

/* Pied de page : logos des jeux et copyright, comme sur l'overlay. */
footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 0 max(24px, env(safe-area-inset-bottom));
}

.game {
  height: clamp(40px, 7vh, 76px);
  width: auto;
}

.squad {
  justify-self: start;
}

.squad44 {
  justify-self: end;
}

.copyright {
  margin: 0;
  font-size: clamp(12px, 1.1vw, 16px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f6eaea;
  text-shadow: 0 0 8px rgba(200, 40, 40, 0.7), 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

/* Téléphones : vignettes en liste, logos des jeux au-dessus du copyright. */
@media (max-width: 640px) {
  .trailers ul {
    flex-direction: column;
    width: min(100%, 360px);
  }

  .trailer {
    display: flex;
    align-items: center;
    width: 100%;
  }

  .thumb {
    flex: 0 0 128px;
  }

  .thumb::after {
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    background-size: 20px, auto;
  }

  footer {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "squad squad44"
      "copyright copyright";
    row-gap: 12px;
  }

  .squad { grid-area: squad; }
  .squad44 { grid-area: squad44; }

  .copyright {
    grid-area: copyright;
    justify-self: center;
    font-size: 12px;
  }

  .game {
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trailer,
  .discord {
    transition: none;
  }

  .trailer:hover,
  .discord:hover {
    transform: none;
  }
}

/* Commandes du son : bouton marche/arrêt et réglage du volume, dans une même
   pastille en haut à droite. */
#sound-controls {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px 0 0;
  border: 1px solid rgba(242, 239, 232, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s;
}

#sound-controls:hover,
#sound-controls:focus-within {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(242, 239, 232, 0.7);
}

#sound {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 10px 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

#sound:focus-visible,
#volume:focus-visible {
  outline: 2px solid #c8a04a;
  outline-offset: 3px;
}

/* Curseur de volume. --level (0 à 100 %) colore la partie remplie. */
#volume {
  --level: 80%;
  width: 96px;
  height: 20px;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#volume[hidden] {
  display: none;
}

/* Sans curseur (iPhone, iPad) : pastille symétrique autour du bouton. */
#sound-controls:has(#volume[hidden]) {
  padding-right: 8px;
}

#volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #f2efe8 var(--level), rgba(242, 239, 232, 0.25) var(--level));
}

#volume::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(242, 239, 232, 0.25);
}

#volume::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: #f2efe8;
}

#volume::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #f2efe8;
  -webkit-appearance: none;
  appearance: none;
}

#volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #f2efe8;
}

/* Son coupé : le curseur reste utilisable mais s'efface. */
#sound-controls.off #volume {
  opacity: 0.5;
}

/* Haut-parleur barré (son coupé) ou avec ondes (son actif), en CSS pur. */
#sound .icon {
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4z' fill='black'/%3E%3Cpath d='m23 9-6 6M17 9l6 6'/%3E%3C/svg%3E");
}

#sound-controls:not(.off) .icon {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4z' fill='black'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E");
}

/* Tant que le son n'a jamais été lancé, la pastille pulse doucement. */
#sound-controls.invite {
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    border-color: rgba(242, 239, 232, 0.8);
    box-shadow: 0 0 0 6px rgba(242, 239, 232, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  #sound-controls.invite {
    animation: none;
  }
}
