:root {
  --bg: #04070f;
  --blue: #3b82f6;
  --blue-bright: #60a5fa;
  --blue-ice: #93c5fd;
  --blue-deep: #1d4ed8;
  --text: #eef2fa;
  --text-dim: #7e8aa3;
  --separator: rgba(96, 165, 250, 0.22);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(29, 78, 216, 0.16), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(30, 58, 138, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ---------- Décor de fond ---------- */

/* Pattern de points avec dérive lente */
.bg-dots {
  position: fixed;
  inset: -60px;
  background-image: radial-gradient(rgba(147, 197, 253, 0.14) 1px, transparent 1.5px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, black 20%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, black 20%, transparent 95%);
  animation: drift 40s linear infinite;
  pointer-events: none;
}

@keyframes drift {
  from { background-position: 0 0; }
  to { background-position: 34px 68px; }
}

/* Fines lignes horizontales de balayage */
.bg-lines {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(96, 165, 250, 0.03) 50%, transparent 100%);
  background-size: 100% 8px;
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 7px,
    rgba(96, 165, 250, 0.025) 8px
  );
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 10%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 10%, transparent 90%);
  pointer-events: none;
}

/* Orbes lumineuses flottantes */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: 8%;
  left: 12%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.20), transparent 65%);
  animation: float-1 18s ease-in-out infinite;
}

.orb-2 {
  width: 460px;
  height: 460px;
  bottom: 4%;
  right: 10%;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.18), transparent 65%);
  animation: float-2 22s ease-in-out infinite;
}

.orb-3 {
  width: 380px;
  height: 380px;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(96, 165, 250, 0.12), transparent 65%);
  animation: float-3 14s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -60px) scale(1.08); }
}

@keyframes float-3 {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
  50% { transform: translateX(-50%) scale(1.25); opacity: 0.5; }
}

/* Grain subtil pour la texture */
.bg-noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
}

/* Particules montantes */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particles span {
  position: absolute;
  bottom: -8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--blue-bright);
  opacity: 0;
  animation: rise linear infinite;
}

.particles span:nth-child(1)  { left: 8%;  animation-duration: 13s; animation-delay: 0s;   }
.particles span:nth-child(2)  { left: 18%; animation-duration: 17s; animation-delay: 3s;  width: 2px; height: 2px; }
.particles span:nth-child(3)  { left: 27%; animation-duration: 11s; animation-delay: 6s;   }
.particles span:nth-child(4)  { left: 36%; animation-duration: 19s; animation-delay: 1.5s; width: 2px; height: 2px; }
.particles span:nth-child(5)  { left: 45%; animation-duration: 14s; animation-delay: 8s;   }
.particles span:nth-child(6)  { left: 54%; animation-duration: 16s; animation-delay: 4s;  width: 4px; height: 4px; }
.particles span:nth-child(7)  { left: 63%; animation-duration: 12s; animation-delay: 9s;   }
.particles span:nth-child(8)  { left: 72%; animation-duration: 18s; animation-delay: 2s;  width: 2px; height: 2px; }
.particles span:nth-child(9)  { left: 81%; animation-duration: 15s; animation-delay: 7s;   }
.particles span:nth-child(10) { left: 90%; animation-duration: 13s; animation-delay: 5s;  width: 2px; height: 2px; }
.particles span:nth-child(11) { left: 12%; animation-duration: 20s; animation-delay: 10s;  }
.particles span:nth-child(12) { left: 68%; animation-duration: 16s; animation-delay: 12s; width: 4px; height: 4px; }

@keyframes rise {
  0% { transform: translateY(0); opacity: 0; }
  8% { opacity: 0.7; }
  90% { opacity: 0.15; }
  100% { transform: translateY(-105vh); opacity: 0; }
}

/* ---------- Sélecteur de langue ---------- */

.lang-switcher {
  position: fixed;
  top: 26px;
  right: 30px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  font-family: "Sora", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 7px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, text-shadow 0.25s ease;
}

.lang-btn:hover {
  color: var(--blue-ice);
  background: rgba(96, 165, 250, 0.07);
}

.lang-btn.active {
  color: var(--blue-bright);
  text-shadow: 0 0 16px rgba(96, 165, 250, 0.55);
  background: rgba(96, 165, 250, 0.09);
}

.lang-sep {
  width: 1px;
  height: 16px;
  background: linear-gradient(to bottom, transparent, var(--separator) 30%, var(--separator) 70%, transparent);
}

@media (max-width: 480px) {
  .lang-switcher {
    top: 16px;
    right: 16px;
  }
}

/* ---------- Widget Discord ---------- */

.discord-widget {
  position: fixed;
  /* Valeur de repli — widget.js centre le widget dans l'espace libre à gauche */
  left: 34px;
  top: 50%;
  /* "translate" est indépendant de "transform", que l'animation reveal anime */
  translate: 0 -50%;
  z-index: 5;
}

.widget-frame {
  position: relative;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(
    160deg,
    rgba(96, 165, 250, 0.45) 0%,
    rgba(96, 165, 250, 0.08) 35%,
    rgba(29, 78, 216, 0.08) 65%,
    rgba(59, 130, 246, 0.35) 100%
  );
  box-shadow:
    0 18px 60px rgba(2, 6, 18, 0.7),
    0 0 42px rgba(29, 78, 216, 0.16);
  transition: box-shadow 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.widget-frame:hover {
  transform: translateY(-3px);
  box-shadow:
    0 24px 70px rgba(2, 6, 18, 0.75),
    0 0 56px rgba(59, 130, 246, 0.28);
}

.widget-frame iframe {
  display: block;
  border-radius: 17px;
  background: #0b101d;
}

/* Le widget passe sous le contenu sur écrans étroits */
@media (max-width: 1180px) {
  .discord-widget {
    position: static;
    translate: none;
    order: 2;
    margin: 56px auto 40px;
  }

  body {
    flex-direction: column;
    overflow-y: auto;
    padding: 48px 0;
    height: auto;
    min-height: 100%;
  }
}

@media (max-width: 400px) {
  .widget-frame iframe {
    width: 300px;
  }
}

/* ---------- Contenu ---------- */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

/* Entrée en cascade */
.reveal {
  opacity: 0;
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-ice);
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
  backdrop-filter: blur(6px);
  margin-bottom: 30px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 10px var(--blue-bright);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

/* Titre */
.title {
  font-family: "Sora", sans-serif;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
  filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.3));
  background: linear-gradient(180deg, #e3ecfb 15%, #a9bede 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title .accent {
  background: linear-gradient(
    110deg,
    var(--blue-ice) 0%,
    var(--blue-bright) 25%,
    var(--blue) 45%,
    #dbeafe 55%,
    var(--blue) 65%,
    var(--blue-deep) 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 5s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.subtitle {
  margin-top: 20px;
  font-size: clamp(0.95rem, 2vw, 1.12rem);
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.01em;
  max-width: 480px;
}

/* Bouton Discord — style natif Discord (blurple, plat, peu arrondi) */
.discord-btn {
  position: relative;
  margin-top: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  background: #5865f2;
  border: none;
  box-shadow: 0 8px 28px rgba(88, 101, 242, 0.28);
  transition: background 0.17s ease, box-shadow 0.25s ease;
}

.discord-btn:hover {
  background: #4752c4;
  box-shadow: 0 8px 32px rgba(88, 101, 242, 0.38);
}

.discord-btn:active {
  background: #3c45a5;
}

/* Utilisateur connecté */
.user-chip {
  margin-top: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 12px;
  border-radius: 4px;
  background: rgba(88, 101, 242, 0.10);
  border: 1px solid rgba(88, 101, 242, 0.35);
}

.user-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border-radius: 4px;
  transition: opacity 0.2s ease;
}

.user-link:hover {
  opacity: 0.85;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.logout-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  padding: 8px 14px;
  border-radius: 4px;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: #5865f2;
  transition: background 0.17s ease;
}

.logout-btn:hover {
  background: #4752c4;
}

/* ---------- Stats : sans background, séparateurs fins ---------- */

.stats {
  margin-top: 78px;
  display: flex;
  align-items: stretch;
  gap: clamp(30px, 6.5vw, 70px);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 96px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat:hover {
  transform: translateY(-4px);
}

.stat-value {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 20%, #9db4dd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: text-shadow 0.3s ease;
}

.stat:hover .stat-value {
  text-shadow: 0 0 28px rgba(96, 165, 250, 0.55);
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  transition: color 0.3s ease;
}

.stat:hover .stat-label {
  color: var(--blue-ice);
}

.separator {
  width: 1px;
  align-self: center;
  height: 52px;
  background: linear-gradient(to bottom, transparent, var(--separator) 30%, var(--separator) 70%, transparent);
  position: relative;
}

/* Point lumineux qui parcourt le séparateur */
.separator::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(to bottom, transparent, var(--blue-bright), transparent);
  opacity: 0.8;
  animation: scan 3s ease-in-out infinite;
}

.separator:nth-of-type(4)::after {
  animation-delay: 1.5s;
}

@keyframes scan {
  0%, 100% { top: 0; opacity: 0; }
  15% { opacity: 0.9; }
  50% { top: calc(100% - 14px); opacity: 0.9; }
  85% { opacity: 0.9; }
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .stats {
    gap: 18px;
    margin-top: 60px;
  }
  .stat {
    min-width: 74px;
  }
  .separator {
    height: 40px;
  }
  .orb {
    filter: blur(60px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
  }
}

/* ---------- Toasts ---------- */

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}

body.dash-body .toast-stack {
  top: 78px;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 36px rgba(2, 6, 18, 0.55);
  cursor: pointer;
  animation: toastIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.toast-success {
  color: #d1fae5;
  background: rgba(6, 18, 16, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.toast-success svg {
  color: #34d399;
}

.toast-error {
  color: #fecaca;
  background: rgba(22, 10, 12, 0.92);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.toast-error svg {
  color: #f87171;
}

.toast.hiding {
  animation: toastOut 0.26s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(18px) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(18px);
  }
}

/* Bannière compte banni (landing) */
.ban-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(520px, calc(100vw - 40px));
  margin: 0 auto 28px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(28, 8, 12, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(220, 38, 38, 0.12);
  text-align: left;
}

.ban-notice svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #f87171;
  margin-top: 2px;
}

.ban-notice-content {
  flex: 1;
  min-width: 0;
}

.ban-notice-content strong {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 0.95rem;
  color: #fecaca;
  margin-bottom: 6px;
}

.ban-notice-content p {
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(254, 202, 202, 0.85);
  margin: 0;
}

.ban-duration {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  color: #fecaca !important;
  margin: 8px 0 10px !important;
}

.deban-form {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deban-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(254, 202, 202, 0.9);
}

.deban-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 0.86rem;
  resize: vertical;
  min-height: 88px;
  outline: none;
}

.deban-form textarea:focus {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.deban-form .ban-notice-btn {
  align-self: flex-start;
  cursor: pointer;
  border: none;
}

.deban-form .ban-notice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.deban-status-msg {
  font-size: 0.82rem;
  color: #fde68a;
  margin: 0 !important;
}

.deban-status-msg.ok {
  color: #86efac;
}

.deban-status-msg.hidden {
  display: none;
}

.deban-login-hint {
  margin-top: 10px !important;
  font-size: 0.82rem !important;
  color: rgba(254, 202, 202, 0.65) !important;
}

.ban-notice-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.ban-notice-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: #5865f2;
  border: 1px solid rgba(88, 101, 242, 0.5);
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
}

.ban-notice-btn:hover {
  background: #4752c4;
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.35);
}

.ban-notice-dismiss {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(254, 202, 202, 0.5);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.ban-notice-dismiss:hover {
  color: #fecaca;
}

@media (max-width: 600px) {
  .ban-notice {
    flex-wrap: wrap;
  }

  .ban-notice-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
