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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(34vmax 34vmax at 6% 8%, var(--blob), transparent 70%),
    radial-gradient(30vmax 30vmax at 96% 38%, var(--blob), transparent 70%),
    radial-gradient(36vmax 36vmax at 18% 96%, var(--blob), transparent 70%);
  filter: blur(40px);
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, .stat strong, .brand { color: var(--heading); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

.container {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .01em;
}

.brand-logo { width: 42px; height: 42px; flex: none; display: block; object-fit: contain; }

.main-nav { display: flex; gap: 6px; height: 100%; }

.main-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-soft);
  transition: color .2s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .25s var(--ease);
}

.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: var(--text); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.icon-button:hover { background: var(--border); border-color: var(--border-strong); }
.icon-button svg { width: 18px; height: 18px; fill: currentColor; }
/* Icône tracée en traits (déconnexion) : sans remplissage, sinon elle apparaît pleine et écrasée */
.icon-button svg.icon-stroke { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

@supports (text-box: trim-both cap alphabetic) {
  .button { text-box: trim-both cap alphabetic; }
}

.button:hover { border-color: var(--text-soft); }
.button:active { transform: translateY(1px); }

.button svg { width: 16px; height: 16px; fill: currentColor; }

.button-primary {
  border-color: rgba(0, 0, 0, .3);
  background: linear-gradient(180deg, #fff07a, var(--accent) 45%, var(--accent-strong));
  color: var(--accent-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 24px rgba(255, 225, 77, .28);
}

.button-primary:hover { border-color: rgba(0, 0, 0, .3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 8px 32px rgba(255, 225, 77, .45); }

.button-large { height: 56px; padding: 0 32px; font-size: 17px; border-radius: var(--radius); }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  padding: 32px 0;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto 35%;
  height: 120%;
  background: radial-gradient(closest-side, rgba(255, 225, 77, .16), transparent 75%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-soft);
}

.eyebrow .status-dot { margin-right: 4px; }

.eyebrow b { font-weight: 600; color: var(--accent-ink); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 0 rgba(63, 191, 90, .6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(63, 191, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 191, 90, 0); }
}

.hero h1 {
  margin: 16px 0 18px;
  font-family: var(--font-title);
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: .01em;
}

.hero p {
  max-width: 540px;
  margin: 0 0 32px;
  font-size: 18px;
  color: var(--text-soft);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* L'île est un visuel en hauteur (619×894) : on plafonne sa hauteur pour qu'elle tienne dans l'écran, à côté du texte, sans dépasser. */
.hero-art { justify-self: center; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - var(--header-height) - 72px); max-height: calc(100svh - var(--header-height) - 72px); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)); animation: float 7s ease-in-out infinite; }

@keyframes float { 50% { transform: translateY(-8px); } }

.nav-toggle, .main-nav .nav-login { display: none; }

.section { padding: 56px 0; }

.section-head { margin-bottom: 32px; }
.section-head h2 { margin: 0 0 6px; font-family: var(--font-title); font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: .01em; }
.section-head p { margin: 0; color: var(--text-soft); }

.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-head-row a { flex: none; white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--text-soft); }
.section-head-row a:hover { color: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.step {
  position: relative;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  opacity: .62;
  transition: opacity .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
  cursor: default;
}

.step.is-active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 60px rgba(255, 225, 77, .18);
  transform: translateY(-4px);
}

.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 30px;
  border-radius: 6px;
  background: var(--border);
  font-weight: 800;
  transition: background .3s var(--ease), color .3s var(--ease);
}

.step.is-active .step-number { background: var(--accent); color: var(--accent-text); }

.step h3 { margin: 0 0 8px; font-size: 19px; }
.step p { margin: 0; font-size: 15px; color: var(--text-soft); }

.steps-cta { display: flex; justify-content: center; margin-top: 36px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.stat { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); }
.stat strong { display: block; font-size: 38px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 14px; color: var(--text-soft); }

.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }

.player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}

.player-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.player-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3b4a6b, #243049);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  image-rendering: pixelated;
}

.player-avatar.is-online::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--bg-raised);
  border-radius: 50%;
  background: var(--online);
}

.player-meta { min-width: 0; }
.player-name { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-sub { display: block; font-size: 13px; color: var(--text-faint); }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
}

.badge-moderator { color: var(--rarity-rare); }
.badge-admin { color: var(--rarity-legendary); }

.cta-band {
  position: relative;
  padding: 56px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: radial-gradient(70% 140% at 50% 0%, rgba(255, 225, 77, .14), transparent 70%), var(--bg-raised);
  text-align: center;
}

.cta-band h2 { margin: 0 0 10px; font-family: var(--font-title); font-size: clamp(26px, 3.6vw, 40px); font-weight: 700; letter-spacing: .01em; }
.cta-band p { max-width: 460px; margin: 0 auto 26px; color: var(--text-soft); }

.site-footer { margin-top: auto; padding: 28px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-faint); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 18px; }

@media (max-width: 900px) {
  :root { --header-height: 58px; }
  .container { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .site-header .container { gap: 12px; }
  .nav-toggle { display: grid; }
  .button-login { display: none; }
  .main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: auto;
    flex-direction: column;
    gap: 0;
    padding: 8px 18px 14px;
    /* Fond opaque : le flou ne fonctionne pas ici (l'en-tête a déjà son propre flou, un second ne s'applique pas à l'intérieur) */
    background: rgb(9, 9, 12);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 30px rgba(0, 0, 0, .5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }
  .site-header.is-open .main-nav { opacity: 1; visibility: visible; transform: none; }
  .main-nav a { min-height: 52px; padding: 0 4px; border-bottom: 1px solid var(--border); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a::after { display: none; }
  .main-nav a[aria-current="page"] { color: var(--accent); }
  .main-nav .nav-login { display: flex; }
  .hero { padding: 24px 0 36px; }
  .hero .container { grid-template-columns: 1fr; gap: 20px; }
  .hero-art { max-height: 46svh; margin: 0 auto; order: -1; }
  .hero p { font-size: 16px; margin-bottom: 24px; }
  .section { padding: 36px 0; }
  .steps, .stats { grid-template-columns: 1fr; gap: 14px; }
  .step { opacity: 1; padding: 20px; }
  .step-number { margin-bottom: 16px; }
  .stat { padding: 20px; }
  .cta-band { padding: 40px 20px; }
}

@media (max-width: 560px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .button, .steps-cta .button, .cta-band .button { width: 100%; }
  .button-large { height: 52px; padding: 0 22px; }
  .player-grid { grid-template-columns: 1fr; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
  .header-actions .button-primary { height: 40px; padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* « En savoir plus » : la section ne passe pas sous l'en-tête */
#how-it-works { scroll-margin-top: var(--header-height); }
