:root {
  --fond: #0d0f13;
  --fond-carte: #161a21;
  --fond-carte-survol: #1d232c;
  --bord: #262d38;
  --texte: #e8ecf2;
  --texte-doux: #97a1b0;
  --accent: #5b9dff;
  --rayon: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.enveloppe {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ---------- En-tête ---------- */

.entete {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--bord);
  margin-bottom: 34px;
}

.entete .logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), #8b5bff);
  display: grid;
  place-items: center;
  flex: none;
}

.entete .logo svg { width: 20px; height: 20px; fill: #fff; }

.entete h1 {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: .2px;
  margin: 0;
}

.entete .compte {
  margin-left: auto;
  color: var(--texte-doux);
  font-size: .85rem;
}

/* ---------- Grille ---------- */

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 26px 22px;
}

.carte { display: block; }

.carte .vignette {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--fond-carte);
  border: 1px solid var(--bord);
  transition: transform .18s ease, border-color .18s ease;
}

.carte:hover .vignette {
  transform: translateY(-3px);
  border-color: #3c4757;
}

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

.carte .vignette .vide {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #3d4654;
}

.carte .vignette .vide svg { width: 40px; height: 40px; fill: currentColor; }

.carte .duree {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 5px;
}

.carte h2 {
  font-size: .98rem;
  font-weight: 600;
  margin: 12px 0 5px;
  line-height: 1.35;
  word-break: break-word;
}

.carte .meta {
  font-size: .82rem;
  color: var(--texte-doux);
}

/* ---------- Lecteur ---------- */

.retour {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--texte-doux);
  font-size: .9rem;
  margin-bottom: 18px;
}

.retour:hover { color: var(--texte); }
.retour svg { width: 15px; height: 15px; fill: currentColor; }

.scene {
  background: #000;
  border-radius: var(--rayon);
  overflow: hidden;
  border: 1px solid var(--bord);
}

.scene video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

.titre-video {
  font-size: 1.4rem;
  font-weight: 650;
  margin: 22px 0 8px;
  line-height: 1.3;
  word-break: break-word;
}

.infos-video {
  color: var(--texte-doux);
  font-size: .9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.infos-video .telecharger {
  margin-left: auto;
  border: 1px solid var(--bord);
  border-radius: 999px;
  padding: 7px 15px;
  color: var(--texte);
  transition: background .15s ease;
}

.infos-video .telecharger:hover { background: var(--fond-carte-survol); }

.description {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--fond-carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  color: var(--texte-doux);
  line-height: 1.6;
  font-size: .93rem;
  white-space: pre-wrap;
}

.section-suite {
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--bord);
}

.section-suite h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--texte-doux);
  margin: 0 0 20px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ---------- États ---------- */

.message {
  text-align: center;
  color: var(--texte-doux);
  padding: 70px 20px;
  line-height: 1.7;
}

.message code {
  background: var(--fond-carte);
  border: 1px solid var(--bord);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: .88em;
}

@media (max-width: 640px) {
  .enveloppe { padding: 0 16px 60px; }
  .grille { grid-template-columns: 1fr; gap: 22px; }
  .titre-video { font-size: 1.15rem; }
  .infos-video .telecharger { margin-left: 0; }
}
