:root{
  --bg0:#050614;
  --bg1:#0b0c25;

  --text:#eaf0ff;
  --muted:rgba(234,240,255,.72);

  --radius:18px;
  --shadow: 0 18px 60px rgba(0,0,0,.55);

  --accentA: rgba(58,160,255,.22);
  --accentB: rgba(122,60,255,.22);
  --accentC: rgba(255,91,214,.14);

  --btnGrad: linear-gradient(90deg, #5aa7ff, #8a5bff, #ff6bdc);

  /* hauteur approx de la topbar (pour éviter que le contenu passe dessous) */
  --topbarH: 84px;
}

/* reset */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

a{
  color:inherit;
  text-decoration:none;
  transition: .2s ease;
}

/* helpers */
.muted{ color: var(--muted); }
.small{ font-size: 13px; }
.link{
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: .95;
}
.link:hover{ opacity: 1; }

/* ================= BG VIDEO ================= */
.bg{
  position:fixed;
  inset:0;
  z-index:-2;
  overflow:hidden;
}
.bg video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  filter:saturate(1.15) contrast(1.05);
  transform: scale(1.04);
}
.bg::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(900px 600px at 20% 20%, rgba(58,160,255,.18), transparent 55%),
    radial-gradient(900px 600px at 80% 20%, rgba(122,60,255,.18), transparent 55%),
    radial-gradient(900px 600px at 55% 90%, rgba(255,91,214,.10), transparent 55%),
    linear-gradient(180deg, rgba(5,6,20,.65), rgba(11,12,37,.78));
}

/* ================= TOPBAR ================= */
.topbar{
  position:fixed;
  top:0; left:0; right:0;
  z-index:10;
  transform: translateY(-110%);
  transition: transform .25s ease;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(5, 6, 20, .45);
}
.topbar.is-visible{ transform: translateY(0); }

.topbar__inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap: wrap; /* important : évite que ça casse en haut */
}

/* bloc gauche */
.left{
  display:flex;
  align-items:center;
  gap:12px;
  flex: 0 1 auto;
  min-width: unset;
}

.lang{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight:900;
  font-size:12px;
}

.brand{
  font-weight:900;
  letter-spacing:.3px;
}

.players{
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  color: rgba(234,240,255,.86);
}

/* ================= NAVIGATION (structure principale) ================= */
.nav-wrapper{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex: 1 1 520px; /* prend la place restante */
  min-width: 320px;
}

/* menu principal */
.nav-left{
  display:flex;
  gap:10px;
  align-items:center;
  padding:6px;
  border-radius:999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  flex-wrap:wrap;
}

.nav-left a{
  display:inline-block;
  padding: 8px 14px;
  border-radius:999px;
  font-size:14px;
  opacity:.85;
  white-space: nowrap; /* évite les cassures moches */
}

.nav-left a:hover{
  opacity:1;
  background: rgba(255,255,255,.06);
}

.nav-left a.active{
  opacity:1;
  background: linear-gradient(90deg, var(--accentA), var(--accentB), var(--accentC));
  border: 1px solid rgba(255,255,255,.12);
}

/* bloc droite (connexion) */
.nav-right{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  flex: 0 0 auto;
}

/* bouton connexion */
.btn-login{
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  font-weight:600;
}

.btn-login:hover{
  background: rgba(255,255,255,.18);
}

/* bouton register */
.btn-register{
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--btnGrad);
  font-weight:700;
  color:white;
  box-shadow: 0 6px 20px rgba(122,60,255,.4);
  transition: .2s ease;
}

.btn-register:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(122,60,255,.5);
}

/* ================= COMPAT: anciennes pages avec <nav class="nav"> =================
   Si jamais tu oublies de mettre nav-wrapper quelque part, au moins ça reste propre.
*/
.nav{
  display:flex;
  gap:10px;
  align-items:center;
  padding:6px;
  border-radius:999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  flex-wrap:wrap;
}
.nav a{
  display:inline-block;
  padding: 8px 14px;
  border-radius:999px;
  font-size:14px;
  opacity:.85;
  white-space: nowrap;
}
.nav a:hover{
  opacity:1;
  background: rgba(255,255,255,.06);
}

/* ================= PAGE ================= */
.page{
  min-height:100vh;
  padding: calc(var(--topbarH) + 18px) 18px 20px; /* <-- FIX: espace sous topbar */
}

.hero{
  min-height: calc(100vh - (var(--topbarH) + 38px));
  display:grid;
  place-items:center;
  padding-top: 0;
}

.hero__card{
  width: min(860px, 96vw);
  padding: 34px 26px;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  text-align:center;
}

/* ================= FORMULAIRES ================= */
.form-card{ text-align:left; }

.form{
  display:grid;
  gap:10px;
  margin-top: 14px;
}

.form label{ font-size: 13px; opacity:.9; }

.form input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}

.form input:focus{
  border-color: rgba(160,120,255,.55);
  box-shadow: 0 0 0 4px rgba(160,120,255,.14);
}

/* bouton global */
.btn{
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--btnGrad);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: .2s ease;
}

.btn:hover{
  transform: translateY(-2px);
  opacity:.95;
}

/* messages */
.msg{
  min-height: 18px;
  margin: 6px 0 0;
  font-size: 13px;
}

.msg.ok{ color: rgba(180,255,200,.95); }
.msg.bad{ color: rgba(255,160,160,.95); }

/* ================= FOOTER ================= */
.footer{
  max-width:1100px;
  margin:0 auto;
  padding:26px 18px 40px;
  color: rgba(234,240,255,.62);
  font-size:13px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px){
  :root{ --topbarH: 120px; }

  .nav-wrapper{
    flex: 1 1 100%;
    justify-content:center;
    flex-wrap: wrap;
  }

  .nav-right{
    width: 100%;
    justify-content:center;
    margin-top: 6px;
  }
}

@media (max-width: 520px){
  :root{ --topbarH: 140px; }

  .left{
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}