:root{
  --bg0:#070815;
  --bg1:#0b0c1f;
  --text:#eaf0ff;
  --muted:rgba(234,240,255,.72);
  --glass:rgba(255,255,255,.06);

  --blue:#3aa0ff;
  --violet:#7a3cff;
  --gold:#f6c35b;
  --gold2:#ffd67a;

  --radius:18px;
  --shadow: 0 18px 60px rgba(0,0,0,.55);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background: radial-gradient(1200px 800px at 30% 10%, rgba(122,60,255,.18), transparent 55%),
              radial-gradient(1000px 700px at 80% 20%, rgba(58,160,255,.16), transparent 55%),
              radial-gradient(900px 700px at 55% 90%, rgba(246,195,91,.12), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}

/* Background layers */
.bg{
  position:fixed;
  inset:0;
  z-index:-1;
  overflow:hidden;
}

.bg__glow{
  position:absolute;
  width:900px; height:900px;
  filter: blur(30px);
  opacity:.65;
  transform: translate3d(0,0,0);
  animation: floaty 10s ease-in-out infinite;
}
.bg__glow--one{
  left:-240px; top:-260px;
  background: radial-gradient(circle at 30% 30%, rgba(58,160,255,.55), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(122,60,255,.45), transparent 60%);
}
.bg__glow--two{
  right:-300px; top:-120px;
  width:980px; height:980px;
  background: radial-gradient(circle at 30% 30%, rgba(246,195,91,.55), transparent 62%),
              radial-gradient(circle at 70% 70%, rgba(58,160,255,.25), transparent 62%);
  animation-delay:-3s;
}
.bg__glow--three{
  left:20%; bottom:-520px;
  width:1200px; height:1200px;
  background: radial-gradient(circle at 40% 35%, rgba(122,60,255,.35), transparent 60%),
              radial-gradient(circle at 60% 70%, rgba(246,195,91,.25), transparent 60%);
  animation-delay:-6s;
}

@keyframes floaty{
  0%,100% { transform: translateY(0) translateX(0) scale(1); }
  50%     { transform: translateY(25px) translateX(18px) scale(1.02); }
}

.bg__noise{
  position:absolute; inset:0;
  opacity:.08;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Waves */
.waves{
  position:absolute;
  left:0;
  width:140%;
  height:140px;
  fill: rgba(255,255,255,.06);
  filter: drop-shadow(0 20px 50px rgba(0,0,0,.35));
  animation: drift 14s linear infinite;
}
.waves--top{
  top:0;
  transform: translateX(-10%);
  opacity:.75;
}
.waves--bottom{
  bottom:0;
  transform: translateX(-15%) rotate(180deg);
  opacity:.85;
  animation-duration: 18s;
}

@keyframes drift{
  0%{ transform: translateX(-18%); }
  100%{ transform: translateX(-2%); }
}

/* Page layout */
.page{
  min-height:100vh;
  padding: 24px 18px 60px;
}

/* Navbar */
.topbar{
  position:fixed;
  top:0; left:0; right:0;
  z-index:10;
  transform: translateY(-110%);
  transition: transform .22s ease, background .22s ease, border-color .22s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(5, 6, 18, .35);
}
.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;
}

.brand{
  display:flex; align-items:center; gap:10px;
  white-space:nowrap;
}
.brand__dot{
  width:10px; height:10px; border-radius:999px;
  background: radial-gradient(circle at 30% 30%, var(--gold2), var(--gold));
  box-shadow: 0 0 18px rgba(246,195,91,.35);
}
.brand__name{
  font-weight:700;
  letter-spacing:.3px;
  opacity:.92;
}

/* Badge joueurs en ligne */
.players{
  display:flex; align-items:center; gap:8px;
  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);
}
.players__led{
  width:8px; height:8px; border-radius:999px;
  background: rgba(255,255,255,.25);
  box-shadow:none;
}
.players.is-online .players__led{
  background: #33ff99;
  box-shadow: 0 0 16px rgba(51,255,153,.35);
}
.players.is-offline .players__led{
  background: #ff4d6d;
  box-shadow: 0 0 16px rgba(255,77,109,.25);
}
.players__text{ opacity:.95; }

.nav{
  display:flex;
  gap: 8px;
  align-items:center;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  flex-wrap:wrap;
  justify-content:center;
}
.nav__link{
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  opacity: .85;
  transition: opacity .18s ease, background .18s ease, transform .18s ease;
}
.nav__link:hover{
  opacity: 1;
  background: rgba(255,255,255,.06);
  transform: translateY(-1px);
}
.nav__link.is-active{
  opacity: 1;
  background: linear-gradient(90deg, rgba(58,160,255,.18), rgba(122,60,255,.18), rgba(246,195,91,.14));
  border: 1px solid rgba(255,255,255,.10);
}

.topbar__actions{
  display:flex; gap:10px; align-items:center;
}

/* Buttons */
.btn{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 14px;
  cursor:pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
}
.btn--solid{
  border-color: rgba(246,195,91,.35);
  background: linear-gradient(90deg, rgba(58,160,255,.18), rgba(122,60,255,.22), rgba(246,195,91,.22));
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.btn--{  background: (0,0,0,.35); }

.btn--ghost{ background: rgba(255,255,255,.04); }

/* Hero */
.hero{
  min-height: calc(100vh - 60px);
  display:grid;
  place-items:center;
  padding-top: 42px;
}

.hero__card{
  width: min(820px, 96vw);
  padding: 34px 26px;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  text-align:center;
  position:relative;
  overflow:hidden;
}

.hero__card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(700px 300px at 20% 0%, rgba(58,160,255,.16), transparent 60%),
              radial-gradient(700px 300px at 80% 10%, rgba(122,60,255,.14), transparent 60%),
              radial-gradient(700px 300px at 50% 100%, rgba(246,195,91,.10), transparent 60%);
  pointer-events:none;
}

.hero__logoWrap{
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
  position:relative;
  display:grid;
  place-items:center;
}
.hero__logo{
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 22px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 14px 45px rgba(0,0,0,.45);
}

.hero__ring{
  position:absolute;
  inset:-14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    conic-gradient(from 120deg,
      rgba(58,160,255,.0),
      rgba(58,160,255,.25),
      rgba(122,60,255,.25),
      rgba(246,195,91,.20),
      rgba(58,160,255,.0)
    );
  animation: spin 8s linear infinite;
  opacity:.9;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.hero__title{
  margin: 10px 0 6px;
  font-size: clamp(34px, 6vw, 56px);
  letter-spacing: .4px;
}
.hero__subtitle{
  margin: 0 auto 18px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.hero__cta{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap: 12px;
  margin-top: 10px;
}

.hero__hint{
  margin-top: 16px;
  font-size: 13px;
  color: rgba(234,240,255,.62);
}

/* Content blocks */
.section{
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 10px 30px;
}
.section h2{ margin: 0 0 10px; font-size: 28px; }
.section p{
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}
.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.panel{
  padding: 18px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.panel h3{ margin: 0 0 6px; }
.panel p{ margin: 0; color: rgba(234,240,255,.70); }

.footer{
  max-width:1100px;
  margin: 40px auto 0;
  padding: 18px 10px;
  color: rgba(234,240,255,.55);
  text-align:center;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Responsive */
@media (max-width: 1040px){
  .topbar__inner{ flex-wrap:wrap; justify-content:center; }
  .topbar__actions{ width:100%; justify-content:center; }
}
@media (max-width: 760px){
  .grid{ grid-template-columns: 1fr; }
  .nav{ width:100%; }
}

/* ============================= */
/* ===== Pages Auth (login/register) ===== */
/* ============================= */
.auth{
  min-height: calc(100vh - 60px);
  display:grid;
  place-items:center;
  padding-top: 42px;
}

.auth__card{
  width: min(520px, 96vw);
  padding: 26px 22px;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
}

.auth__card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(700px 300px at 20% 0%, rgba(58,160,255,.14), transparent 60%),
              radial-gradient(700px 300px at 80% 10%, rgba(122,60,255,.12), transparent 60%),
              radial-gradient(700px 300px at 50% 100%, rgba(246,195,91,.10), transparent 60%);
  pointer-events:none;
}

.form{
  display:grid;
  gap: 12px;
  margin-top: 14px;
}

.field{
  display:grid;
  gap: 6px;
}

.label{
  font-size: 13px;
  color: rgba(234,240,255,.70);
}

.input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline: none;
}

.input:focus{
  border-color: rgba(246,195,91,.35);
  box-shadow: 0 0 0 3px rgba(246,195,91,.12);
}

.form__row{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  margin-top: 8px;
}

.msg{
  margin-top: 12px;
  font-size: 14px;
  color: rgba(234,240,255,.82);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}

.msg.is-error{
  border-color: rgba(255,77,109,.35);
  background: rgba(255,77,109,.08);
}

.msg.is-ok{
  border-color: rgba(51,255,153,.35);
  background: rgba(51,255,153,.08);
}

/* ===== Toggle mot de passe ===== */
.inputWrap{
  position: relative;
}

.pwToggle{
  position:absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: rgba(234,240,255,.85);
  cursor: pointer;
  font-size: 13px;
}

.pwToggle:hover{
  border-color: rgba(246,195,91,.35);
}

.pwToggle:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(246,195,91,.12);
}

/* ========= Badge utilisateur connecté dans la topbar ========= */
.userBadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 14px;
  cursor: default;
}

.userBadge__avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.userBadge__name {
  max-width: 140px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* ===================================================== */
/* ===== Transitions entre pages (slide, pas brutal) ==== */
/* ===================================================== */

.page-transition{
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  background: rgba(7, 8, 21, .42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 220ms ease;
}
.page-transition.is-on{ opacity: 1; }

.page-wrap{ will-change: transform, opacity; }

.page-wrap.enter-left{  animation: enterLeft 260ms ease both; }
.page-wrap.enter-right{ animation: enterRight 260ms ease both; }
.page-wrap.exit-left{  animation: exitLeft 240ms ease both; }
.page-wrap.exit-right{ animation: exitRight 240ms ease both; }

@keyframes enterLeft{
  from{ transform: translateX(18px); opacity: 0; }
  to{ transform: translateX(0); opacity: 1; }
}
@keyframes enterRight{
  from{ transform: translateX(-18px); opacity: 0; }
  to{ transform: translateX(0); opacity: 1; }
}
@keyframes exitLeft{
  from{ transform: translateX(0); opacity: 1; }
  to{ transform: translateX(-18px); opacity: 0; }
}
@keyframes exitRight{
  from{ transform: translateX(0); opacity: 1; }
  to{ transform: translateX(18px); opacity: 0; }
}
.userMenu{ position:relative; display:flex; align-items:center; }

.userMenu__btn{
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  cursor: pointer;
  display:grid;
  place-items:center;
  padding: 0;
}

.userMenu__btn:hover{
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}

.userMenu__avatar{
  width: 34px; height: 34px;
  border-radius: 999px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,.12);
}

.userMenu__dropdown{
  position:absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 190px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(7, 8, 21, .75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}

.userMenu__name{
  font-weight: 700;
  margin-bottom: 10px;
  opacity: .95;
}
.langToggle{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 10px;border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:inherit;cursor:pointer;user-select:none;
  transition:transform .12s ease, background .12s ease;
}
.langToggle:hover{background:rgba(255,255,255,.10);}
.langToggle:active{transform:scale(.98);}
.langToggle__pill{
  font-size:12px;padding:2px 8px;border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  opacity:.95;
}