/* ==========================================================================
   LA VEILLÉE DU DOFUS — écran d'accueil / serveurs / personnages / création
   Aucune image de fond : tout le décor (ciel, étoiles, collines, lucioles,
   Dofus émeraude) est dessiné en CSS et SVG inline.
   ========================================================================== */

html, body { min-height: 100%; }
body.account-gate-active { overflow: hidden; }
body.account-gate-active #game-shell { visibility: hidden; pointer-events: none; }
#account-gate-root[hidden] { display: none !important; }
#account-gate-root { position: fixed; inset: 0; z-index: 100000; }

/* ---------- Jetons de design ------------------------------------------- */
.account-gate {
  /* La nuit d'Incarnam */
  --nuit-0: #0a161c;
  --nuit-1: #10232c;
  --nuit-2: #17323c;
  --horizon: #1e4341;
  /* Végétal & lumière */
  --seve: #59b64a;
  --seve-deep: #2c6b34;
  --lueur: #ffd76a;
  --lueur-soft: rgba(255, 215, 106, .28);
  /* Braise (action) */
  --braise: #f68b1f;
  --braise-hot: #ffb356;
  --braise-deep: #b95400;
  /* Parchemin & encre */
  --parchemin: #f4e9cd;
  --parchemin-2: #e9d9b3;
  --parchemin-3: #d9c496;
  --encre: #372c1f;
  --encre-soft: #7a6a50;
  /* Cuir (cadres) */
  --cuir: #4a3826;
  --cuir-dark: #241a0e;
  --or: #d9a63f;
  --or-clair: #f2d488;
  /* Alerte */
  --rouge: #d8432c;

  --font-display: Georgia, 'Times New Roman', serif;
  --font-ui: 'Trebuchet MS', Verdana, Arial, sans-serif;

  --ease-out: cubic-bezier(.22, .8, .32, 1);

  position: absolute;
  inset: 0;
  overflow: auto;
  color: var(--parchemin);
  font-family: var(--font-ui);
  background:
    radial-gradient(120% 90% at 50% 118%, var(--horizon) 0%, transparent 55%),
    radial-gradient(80% 60% at 78% -8%, rgba(89, 182, 74, .10), transparent 60%),
    linear-gradient(180deg, var(--nuit-0) 0%, var(--nuit-1) 46%, var(--nuit-2) 100%);
  -webkit-font-smoothing: antialiased;
}

.account-gate *, .account-gate *::before, .account-gate *::after { box-sizing: border-box; }
.account-gate img { user-select: none; }
.account-gate button { font-family: inherit; }

.account-gate :focus-visible {
  outline: 3px solid var(--lueur);
  outline-offset: 2px;
  border-radius: 6px;
}
.account-gate .gate-field input:focus-visible { outline: none; }

/* ==========================================================================
   LE CIEL — étoiles, lune, collines, brume, lucioles
   ========================================================================== */
.gate-sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }

.gate-sky__stars,
.gate-sky__stars--far {
  position: absolute; inset: -10% -4%;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1.4px 1.4px at 28% 8%,  rgba(255,244,214,.85), transparent 60%),
    radial-gradient(1.8px 1.8px at 44% 22%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.3px 1.3px at 61% 12%, rgba(255,244,214,.9), transparent 60%),
    radial-gradient(1.7px 1.7px at 74% 26%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1.4px 1.4px at 88% 9%,  rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 93% 34%, rgba(255,244,214,.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 6% 42%,  rgba(255,255,255,.65), transparent 60%),
    radial-gradient(1.3px 1.3px at 36% 38%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 55% 44%, rgba(255,244,214,.55), transparent 60%);
  animation: gate-twinkle 6s ease-in-out infinite alternate;
}
.gate-sky__stars--far {
  opacity: .5; transform: scale(1.35);
  animation-duration: 9s; animation-delay: -3s;
}
@keyframes gate-twinkle {
  from { opacity: .55; }
  to   { opacity: 1; }
}

.gate-sky__moon {
  position: absolute; top: 7%; right: 9%;
  width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #fff9e6, #f0dfae 55%, #cbb478);
  box-shadow:
    0 0 34px 10px rgba(255, 240, 190, .22),
    0 0 120px 44px rgba(255, 240, 190, .08),
    inset -14px -10px 26px rgba(160, 132, 70, .35);
}
.gate-sky__moon::after {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(9px 9px at 30% 62%, rgba(160,132,70,.35), transparent 70%),
    radial-gradient(6px 6px at 62% 38%, rgba(160,132,70,.3), transparent 70%),
    radial-gradient(5px 5px at 52% 74%, rgba(160,132,70,.28), transparent 70%);
}

/* Collines superposées à l'horizon */
.gate-sky__hills { position: absolute; left: -6%; right: -6%; bottom: -4%; height: 34%; }
.gate-sky__hills--far {
  background:
    radial-gradient(58% 120% at 16% 118%, #1c4038 0 62%, transparent 63%),
    radial-gradient(62% 130% at 55% 124%, #1a3b35 0 60%, transparent 61%),
    radial-gradient(56% 118% at 92% 120%, #1c4038 0 62%, transparent 63%);
  opacity: .85;
}
.gate-sky__hills--near {
  height: 26%;
  background:
    radial-gradient(52% 128% at 8% 130%,  #122b26 0 62%, transparent 63%),
    radial-gradient(60% 140% at 46% 136%, #10261f 0 60%, transparent 61%),
    radial-gradient(54% 126% at 88% 132%, #122b26 0 62%, transparent 63%);
}

.gate-sky__mist {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22%;
  background: linear-gradient(180deg, transparent, rgba(140, 200, 150, .06) 45%, rgba(140, 200, 150, .1));
}

/* Lucioles */
.gate-firefly {
  position: absolute; bottom: 8%;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--lueur);
  box-shadow: 0 0 10px 3px var(--lueur-soft), 0 0 26px 8px rgba(255, 215, 106, .12);
  opacity: 0;
  animation: gate-firefly-rise 11s linear infinite;
}
.gate-firefly--1 { left: 8%;  animation-delay: 0s;    animation-duration: 12s; }
.gate-firefly--2 { left: 21%; animation-delay: -4s;   animation-duration: 14s; transform: scale(.8); }
.gate-firefly--3 { left: 34%; animation-delay: -8s;   animation-duration: 10s; }
.gate-firefly--4 { left: 52%; animation-delay: -2s;   animation-duration: 15s; transform: scale(.7); }
.gate-firefly--5 { left: 67%; animation-delay: -6.5s; animation-duration: 11s; }
.gate-firefly--6 { left: 81%; animation-delay: -9s;   animation-duration: 13s; transform: scale(.85); }
.gate-firefly--7 { left: 93%; animation-delay: -3.2s; animation-duration: 16s; transform: scale(.65); }
@keyframes gate-firefly-rise {
  0%   { transform: translate(0, 0);            opacity: 0; }
  8%   { opacity: .95; }
  45%  { transform: translate(18px, -34vh);     opacity: .75; }
  55%  { opacity: .25; }
  65%  { opacity: .8; }
  100% { transform: translate(-14px, -78vh);    opacity: 0; }
}

/* ==========================================================================
   STRUCTURE — cadre, barre du haut, pied de page
   ========================================================================== */
.gate-frame {
  position: relative; z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: clamp(10px, 2vh, 22px) clamp(14px, 3vw, 36px);
}

.gate-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: clamp(8px, 1.6vh, 16px);
}

.gate-brand { display: flex; align-items: center; gap: 12px; }
.gate-brand__word { display: grid; line-height: 1.12; }
.gate-brand__word strong {
  font-family: var(--font-display);
  font-size: 17px; letter-spacing: .04em; color: var(--parchemin);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.gate-brand__word strong em { font-style: normal; color: var(--lueur); }
.gate-brand__word small {
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(244, 233, 205, .55);
}

/* Fil d'Ariane des étapes */
.gate-trail { display: flex; align-items: center; gap: 8px; }
.gate-trail__step {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(244, 233, 205, .38); white-space: nowrap;
}
.gate-trail__step i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(244, 233, 205, .25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.gate-trail__step.is-done { color: rgba(244, 233, 205, .68); }
.gate-trail__step.is-done i { background: var(--seve); box-shadow: 0 0 8px rgba(89, 182, 74, .5); }
.gate-trail__step.is-current { color: var(--lueur); }
.gate-trail__step.is-current i { background: var(--lueur); box-shadow: 0 0 10px var(--lueur-soft); }
.gate-trail__link { width: 22px; height: 1px; background: linear-gradient(90deg, transparent, rgba(244,233,205,.3), transparent); }

.gate-topbar__chips { display: flex; align-items: center; gap: 8px; }
.gate-chip {
  display: grid; line-height: 1.15; padding: 6px 13px;
  border: 1px solid rgba(217, 166, 63, .35); border-radius: 11px;
  background: linear-gradient(180deg, rgba(36, 26, 14, .72), rgba(20, 14, 7, .72));
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.gate-chip small { font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(242, 212, 136, .6); }
.gate-chip strong { font-size: 12.5px; color: var(--parchemin); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gate-iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(217, 166, 63, .45); border-radius: 50%;
  color: var(--or-clair); font-size: 15px; cursor: pointer;
  background: linear-gradient(180deg, rgba(74, 56, 38, .9), rgba(36, 26, 14, .9));
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
.gate-iconbtn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 0 0 1px rgba(242, 212, 136, .25); }
.gate-iconbtn:active { transform: translateY(0); }

.gate-footer {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding-top: clamp(8px, 1.6vh, 16px);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(244, 233, 205, .38);
}
.gate-footer i { width: 4px; height: 4px; border-radius: 50%; background: rgba(217, 166, 63, .5); }

/* ==========================================================================
   L'EMBLÈME — le Dofus émeraude
   ========================================================================== */
.gate-egg { display: block; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .45)); }
.gate-egg__halo { transform-origin: 60px 78px; animation: gate-halo 4.6s ease-in-out infinite; }
@keyframes gate-halo {
  0%, 100% { opacity: .12; transform: scale(1); }
  50%      { opacity: .3;  transform: scale(1.06); }
}
.gate-egg--brand { width: 34px; height: auto; }
.gate-egg--hero { width: clamp(150px, 17vw, 220px); height: auto; animation: gate-egg-breathe 5.2s ease-in-out infinite; }
@keyframes gate-egg-breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.gate-egg--register { width: 74px; height: auto; }
.gate-egg--orb { width: 84px; height: auto; }

/* ==========================================================================
   ÉCRANS — apparition
   ========================================================================== */
.gate-stage { min-height: 0; display: grid; align-content: center; }
.gate-screen { animation: gate-screen-in .5s var(--ease-out) both; }
@keyframes gate-screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gate-kicker {
  display: inline-block;
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--lueur); text-shadow: 0 0 18px var(--lueur-soft);
}

.gate-heading { text-align: center; margin: 0 0 clamp(16px, 3vh, 30px); }
.gate-heading h1 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 700; letter-spacing: .01em;
  color: var(--parchemin);
  text-shadow: 0 3px 14px rgba(0, 0, 0, .55);
}
.gate-heading p { margin: 0; font-size: 14px; color: rgba(244, 233, 205, .62); }
.gate-heading--creator { margin-bottom: clamp(10px, 2vh, 18px); }

/* ==========================================================================
   COMPOSANTS — carte parchemin, boutons, champs
   ========================================================================== */
.gate-card {
  position: relative;
  border-radius: 18px;
  padding: clamp(18px, 2.4vw, 26px);
  color: var(--encre);
  background:
    repeating-linear-gradient(0deg, rgba(120, 92, 50, .045) 0 2px, transparent 2px 5px),
    radial-gradient(120% 100% at 50% 0%, var(--parchemin) 0%, var(--parchemin-2) 72%, var(--parchemin-3) 100%);
  border: 2px solid var(--cuir);
  box-shadow:
    0 0 0 1px rgba(242, 212, 136, .5) inset,
    0 0 0 5px rgba(36, 26, 14, .18) inset,
    0 18px 44px rgba(0, 0, 0, .5),
    0 4px 12px rgba(0, 0, 0, .35);
}
/* Coins dorés */
.gate-card::before, .gate-card::after {
  content: ''; position: absolute; width: 22px; height: 22px; pointer-events: none;
  border: 2px solid var(--or); opacity: .8;
}
.gate-card::before { top: 7px; left: 7px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.gate-card::after { bottom: 7px; right: 7px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }

.gate-card__title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.gate-card__title h2 {
  margin: 0; font-family: var(--font-display);
  font-size: 21px; color: var(--encre); letter-spacing: .01em;
}
.gate-card__title small { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--encre-soft); }
.gate-card__title--center { display: grid; justify-items: center; text-align: center; gap: 4px; }
.gate-card__title--center h2 { font-size: 26px; }
.gate-card__title--center p { margin: 2px 0 0; font-size: 13px; color: var(--encre-soft); }
.gate-card__title--center .gate-kicker { color: var(--braise-deep); text-shadow: none; }

/* Boutons */
.gate-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 13px;
  font-family: var(--font-ui); font-size: 14.5px; font-weight: 700; letter-spacing: .02em;
  cursor: pointer;
  transition: transform .16s var(--ease-out), box-shadow .16s, filter .16s;
}
.gate-btn b { font-weight: 900; font-size: 17px; line-height: 0; transform: translateY(-1px); }
.gate-btn:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.4); }

.gate-btn--primary {
  color: #fff8ea; text-shadow: 0 1px 2px rgba(120, 50, 0, .55);
  border: 2px solid #7c3a00;
  background: linear-gradient(180deg, var(--braise-hot) 0%, var(--braise) 46%, var(--braise-deep) 100%);
  box-shadow:
    0 1px 0 rgba(255, 236, 190, .75) inset,
    0 -8px 14px rgba(120, 50, 0, .35) inset,
    0 8px 20px rgba(185, 84, 0, .4),
    0 3px 8px rgba(0, 0, 0, .35);
}
.gate-btn--primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255,236,190,.75) inset, 0 -8px 14px rgba(120,50,0,.35) inset, 0 12px 26px rgba(185, 84, 0, .5), 0 4px 10px rgba(0, 0, 0, .4); }
.gate-btn--primary:active:not(:disabled) { transform: translateY(0); }

.gate-btn--ghost {
  color: var(--parchemin);
  border: 2px solid rgba(217, 166, 63, .45);
  background: linear-gradient(180deg, rgba(74, 56, 38, .92), rgba(36, 26, 14, .92));
  box-shadow: 0 1px 0 rgba(242, 212, 136, .22) inset, 0 4px 12px rgba(0, 0, 0, .35);
}
.gate-btn--ghost:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(242, 212, 136, .6); }
.gate-btn--ghost:active:not(:disabled) { transform: translateY(0); }

/* Cartes parchemin : le bouton fantôme devient encre-sur-parchemin */
.gate-card .gate-btn--ghost {
  color: var(--encre);
  border-color: rgba(74, 56, 38, .5);
  background: linear-gradient(180deg, rgba(255, 251, 238, .8), rgba(233, 217, 179, .8));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 3px 8px rgba(74, 56, 38, .18);
}
.gate-btn--wide { width: 100%; }

/* Champs */
.gate-form { display: grid; gap: 14px; }
.gate-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gate-label { display: grid; gap: 6px; }
.gate-label > span {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--encre-soft);
}
.gate-field {
  display: flex; align-items: center; gap: 9px;
  padding: 0 13px; height: 44px; border-radius: 11px;
  border: 2px solid rgba(74, 56, 38, .4);
  background: linear-gradient(180deg, #fffbee, #f6ecd2);
  box-shadow: inset 0 2px 5px rgba(74, 56, 38, .16);
  transition: border-color .15s, box-shadow .15s;
}
.gate-field:focus-within {
  border-color: var(--braise);
  box-shadow: inset 0 2px 5px rgba(74, 56, 38, .12), 0 0 0 3px rgba(246, 139, 31, .22);
}
.gate-field__icon { font-style: normal; font-size: 13px; color: var(--or); text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.gate-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: var(--font-ui); font-size: 14.5px; color: var(--encre);
}
.gate-field input::placeholder { color: rgba(122, 106, 80, .65); }
.gate-help { font-size: 11px; color: var(--encre-soft); }

.gate-remember { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.gate-remember input {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 1px 0 0; flex: none;
  border: 2px solid rgba(74, 56, 38, .55); border-radius: 6px;
  background: #fffbee; cursor: pointer;
  display: grid; place-items: center;
  transition: background .12s, border-color .12s;
}
.gate-remember input:checked { background: var(--seve); border-color: var(--seve-deep); }
.gate-remember input:checked::after {
  content: '✓'; color: #fff; font-size: 13px; font-weight: 900; line-height: 1;
}
.gate-remember span { display: grid; gap: 1px; line-height: 1.3; }
.gate-remember b { font-size: 13px; color: var(--encre); }
.gate-remember small { font-size: 11px; color: var(--encre-soft); }

.gate-separator {
  display: flex; align-items: center; gap: 12px; margin: 16px 0 12px;
  color: var(--encre-soft); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
}
.gate-separator::before, .gate-separator::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 56, 38, .4), transparent);
}

.gate-note { margin: 12px 0 0; font-size: 11px; line-height: 1.45; color: var(--encre-soft); text-align: center; }

.gate-error {
  margin: 0; padding: 9px 13px; border-radius: 10px;
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #e05a41, var(--rouge));
  border: 1px solid #8f2417;
  box-shadow: 0 3px 10px rgba(216, 67, 44, .35);
}
.gate-error--floating { width: fit-content; margin: 0 auto 14px; }

.gate-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.gate-dot--on { background: var(--seve); box-shadow: 0 0 9px rgba(89, 182, 74, .8); }
.gate-dot--off { background: #6b6154; }

/* ==========================================================================
   ÉCRAN 1 — CONNEXION
   ========================================================================== */
.gate-login {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 420px);
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
}

.gate-login__hero { display: grid; gap: clamp(14px, 2.4vh, 26px); justify-items: start; }

.gate-login__crest {
  position: relative;
  width: 100%; min-height: clamp(190px, 26vh, 270px);
  display: grid; place-items: end center;
}
.gate-login__crest .gate-egg--hero { position: relative; z-index: 2; }

.gate-login__pedestal {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: clamp(220px, 26vw, 330px); height: 44px; z-index: 1;
}
.gate-login__pedestal i {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 42%, #2e5c37 0%, #1b3a24 62%, #10241a 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .55), inset 0 2px 6px rgba(140, 220, 150, .25);
}
.gate-login__pedestal b {
  position: absolute; left: 10%; right: 10%; top: 42%; height: 40%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 215, 106, .3), transparent 70%);
  filter: blur(4px);
}

.gate-login__heroes { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.gate-login__heroimg { position: absolute; bottom: 8px; height: clamp(92px, 12.5vh, 126px); width: clamp(92px, 12.5vh, 126px); object-fit: contain; object-position: bottom center; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
.gate-login__heroimg--one   { left: 23%; }
.gate-login__heroimg--two   { right: 23%; }
.gate-login__heroimg--three { left: 50%; transform: translateX(-118%); bottom: 2px; height: clamp(76px, 10.5vh, 106px); width: clamp(76px, 10.5vh, 106px); opacity: .95; }

.gate-login__copy { justify-self: center; text-align: center; max-width: 560px; }
.gate-login__copy h1 {
  margin: 10px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1.06; letter-spacing: .005em;
  color: var(--parchemin);
  text-shadow: 0 3px 18px rgba(0, 0, 0, .6);
}
.gate-login__copy p { margin: 0 auto; max-width: 46ch; font-size: 14.5px; line-height: 1.55; color: rgba(244, 233, 205, .68); }

.gate-featlist {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
  margin: 16px 0 0; padding: 0; list-style: none;
}
.gate-featlist li {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: rgba(244, 233, 205, .78);
}
.gate-featlist i { font-style: normal; font-size: 10px; color: var(--lueur); }

.gate-login__panel { align-self: center; }

/* ==========================================================================
   ÉCRAN 2 — CRÉATION DE COMPTE
   ========================================================================== */
.gate-register { display: grid; justify-items: center; }
.gate-register__card { width: min(660px, 100%); padding-top: 54px; }
.gate-register__crest {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
}
.gate-register__actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }

/* ==========================================================================
   ÉCRAN 3 — SERVEURS
   ========================================================================== */
.gate-server-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: clamp(12px, 1.8vw, 20px);
  max-width: 1120px; margin: 0 auto clamp(16px, 3vh, 26px);
}

/* Carte-affiche : l'illustration couvre toute la carte, le texte se pose
   sur un dégradé en bas, à la manière d'une carte de tarot du serveur. */
.gate-server {
  position: relative;
  display: block;
  aspect-ratio: 29 / 38;
  min-height: 300px;
  padding: 0; border-radius: 18px;
  overflow: hidden;
  text-align: left; cursor: pointer;
  color: var(--parchemin);
  border: 2px solid rgba(217, 166, 63, .38);
  background: linear-gradient(180deg, #17232c, #0c141b);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  transition: transform .18s var(--ease-out), border-color .18s, box-shadow .18s;
}
.gate-server:hover:not(.gate-server--locked) {
  transform: translateY(-5px);
  border-color: rgba(242, 212, 136, .62);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .5), 0 0 26px rgba(255, 215, 106, .1);
}
.gate-server.is-selected {
  border-color: var(--lueur);
  box-shadow:
    0 0 0 1px rgba(255, 215, 106, .55),
    0 0 34px rgba(255, 215, 106, .2),
    0 14px 32px rgba(0, 0, 0, .55);
}

.gate-server__art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 38%;
  transform: scale(1.02);
  transition: transform .35s var(--ease-out), filter .25s;
}
.gate-server:hover:not(.gate-server--locked) .gate-server__art { transform: scale(1.07); }
.gate-server.is-selected .gate-server__art { filter: saturate(1.08) brightness(1.05); }

.gate-server__artfallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(89, 182, 74, .12), transparent 55%),
    radial-gradient(90% 70% at 50% 100%, rgba(20, 34, 30, .9), transparent 70%),
    linear-gradient(180deg, #17232c, #0b1218);
}
.gate-server__mystery {
  display: grid; place-items: center;
  width: 108px; height: 132px;
  border-radius: 50% 50% 50% 50% / 58% 58% 44% 44%;
  font-family: var(--font-display); font-size: 44px; color: rgba(244, 233, 205, .35);
  border: 2px dashed rgba(217, 166, 63, .3);
  background: radial-gradient(80% 70% at 40% 30%, rgba(244, 233, 205, .06), rgba(9, 14, 19, .55));
  box-shadow: inset 0 0 26px rgba(0, 0, 0, .5);
}

.gate-server__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 13, 18, .38) 0%, transparent 26%),
    linear-gradient(180deg, transparent 38%, rgba(7, 11, 16, .62) 66%, rgba(6, 10, 14, .94) 100%);
}
.gate-server.is-selected .gate-server__scrim {
  background:
    linear-gradient(180deg, rgba(8, 13, 18, .32) 0%, transparent 26%),
    linear-gradient(180deg, transparent 36%, rgba(24, 20, 8, .55) 64%, rgba(10, 9, 4, .94) 100%);
}

.gate-server__mode {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 4px 11px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--or-clair);
  border: 1px solid rgba(217, 166, 63, .55);
  background: rgba(23, 16, 7, .72);
  backdrop-filter: blur(2px);
}

.gate-server__check {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; font-size: 15px; font-weight: 700; color: #1d3311;
  background: linear-gradient(180deg, #ffe9a8, var(--lueur));
  border: 2px solid rgba(255, 244, 205, .85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45), 0 0 14px rgba(255, 215, 106, .5);
  opacity: 0; transform: scale(.5);
  transition: opacity .18s, transform .18s var(--ease-out);
}
.gate-server.is-selected .gate-server__check { opacity: 1; transform: scale(1); }

.gate-server__body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: grid; gap: 7px;
  padding: 14px 15px 13px;
}
.gate-server__name { display: grid; line-height: 1.12; }
.gate-server__name strong {
  font-family: var(--font-display); font-size: 23px; color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}
.gate-server__name span {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--or-clair); text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}
.gate-server__desc {
  display: block;
  font-size: 11.5px; line-height: 1.42;
  color: rgba(244, 233, 205, .82);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .75);
}
.gate-server__status {
  display: flex; align-items: center; gap: 6px;
  padding-top: 8px; margin-top: 2px;
  font-size: 10.5px;
  border-top: 1px solid rgba(244, 233, 205, .16);
}
.gate-server__status b { color: var(--parchemin); font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.gate-server__status small { color: rgba(244, 233, 205, .58); margin-left: auto; }

.gate-server--locked { cursor: default; }

/* Serveur annoncé (ex. Eclipse) : l'affiche est là, l'entrée pas encore. */
.gate-server--soon { cursor: default; }
.gate-server--soon .gate-server__art { filter: saturate(.72) brightness(.82); }
.gate-server--soon .gate-server__artfallback { z-index: -1; }
.gate-server--soon .gate-server__art ~ .gate-server__artfallback { display: none; }
.gate-server--soon.gate-server--noart .gate-server__artfallback { display: grid; z-index: 0; }
.gate-server__ribbon {
  position: absolute; top: 12px; right: -34px; z-index: 2;
  transform: rotate(38deg);
  padding: 4px 38px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: #241806;
  background: linear-gradient(180deg, #ffe9a8, var(--or));
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}
.gate-server--locked .gate-server__body { opacity: .78; }
.gate-server--locked .gate-server__name strong { color: rgba(244, 233, 205, .66); }
.gate-server.is-selected {
  border-color: var(--lueur);
  box-shadow: 0 0 0 1px rgba(255, 215, 106, .5), 0 0 30px rgba(255, 215, 106, .16), 0 12px 30px rgba(0, 0, 0, .5);
}

.gate-server__mode {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--or-clair);
  border: 1px solid rgba(217, 166, 63, .4);
  background: rgba(36, 26, 14, .7);
}



/* Barre d'action commune */
.gate-actionbar {
  display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2.4vw, 26px);
  flex-wrap: wrap;
}
.gate-actionbar__summary {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 13px;
  border: 1px solid rgba(217, 166, 63, .3);
  background: rgba(20, 26, 22, .7);
}
.gate-actionbar__summary small { display: block; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: rgba(244, 233, 205, .5); }
.gate-actionbar__summary strong { font-size: 13.5px; color: var(--parchemin); }
.gate-actionbar__hint { font-size: 11.5px; color: rgba(244, 233, 205, .5); }
.gate-btn--play { min-width: 190px; font-size: 16px; }

/* ==========================================================================
   ÉCRAN 4 — PERSONNAGES
   ========================================================================== */
.gate-select--characters { position: relative; }

.gate-roster {
  position: absolute; inset: -30px 0 auto; height: 150px;
  pointer-events: none; opacity: .17; z-index: -1;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 62%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 62%, transparent);
}
.gate-roster__hero { position: absolute; top: 14px; height: 72px; filter: blur(1.5px) brightness(.8); }
.gate-roster__hero--1 { left: 4%; }
.gate-roster__hero--2 { left: 20%; top: 22px; height: 100px; }
.gate-roster__hero--3 { left: 37%; top: 8px; }
.gate-roster__hero--4 { right: 34%; top: 26px; height: 96px; }
.gate-roster__hero--5 { right: 17%; top: 4px; }
.gate-roster__hero--6 { right: 3%; top: 20px; height: 104px; }

.gate-slot-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
  max-width: 1120px; margin: 0 auto clamp(22px, 4vh, 36px);
}

.gate-slot { display: grid; gap: 10px; justify-items: center; }

.gate-slot__select {
  position: relative;
  width: 100%; height: clamp(175px, 25vh, 230px);
  display: grid; place-items: end center;
  border: 0; background: none; cursor: pointer;
  padding: 0 0 12px;
  transition: transform .18s var(--ease-out);
}
.gate-slot__select:hover { transform: translateY(-4px); }
.gate-slot__select { overflow: visible; }
.gate-slot__select img {
  position: absolute; z-index: 2;
  left: 50%; bottom: 22px; transform: translateX(-50%);
  width: clamp(150px, 13vw, 210px); height: clamp(138px, 20vh, 172px);
  object-fit: contain; object-position: bottom center;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .5));
  transition: filter .18s;
}

.gate-slot__pedestal { position: absolute; bottom: 0; left: 8%; right: 8%; height: 34px; z-index: 1; display: block; }
.gate-slot__pedestal i {
  position: absolute; inset: 0; border-radius: 50%; display: block;
  background: radial-gradient(ellipse at 50% 40%, #2e5c37 0%, #1b3a24 62%, #10241a 100%);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .5), inset 0 2px 5px rgba(140, 220, 150, .22);
}
.gate-slot__pedestal b {
  position: absolute; left: 14%; right: 14%; top: 38%; height: 44%; display: block;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 215, 106, .22), transparent 70%);
  filter: blur(3px);
}

.gate-slot__aura {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  width: 82%; aspect-ratio: 2.4 / 1; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 215, 106, .4), rgba(255, 215, 106, .08) 55%, transparent 72%);
  opacity: 0; transition: opacity .2s;
  z-index: 0;
}
.gate-slot.is-selected .gate-slot__aura { opacity: 1; animation: gate-halo 3.6s ease-in-out infinite; }
.gate-slot.is-selected .gate-slot__select img { filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)) drop-shadow(0 0 14px rgba(255, 215, 106, .45)); }

.gate-slot__plate {
  position: relative;
  width: 100%; display: grid; gap: 1px; justify-items: center;
  padding: 9px 30px 10px; border-radius: 12px;
  text-align: center;
  border: 2px solid var(--cuir);
  background:
    repeating-linear-gradient(0deg, rgba(120, 92, 50, .05) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, var(--parchemin), var(--parchemin-2));
  box-shadow: 0 0 0 1px rgba(242, 212, 136, .45) inset, 0 6px 16px rgba(0, 0, 0, .4);
  transition: border-color .18s, box-shadow .18s;
}
.gate-slot.is-selected .gate-slot__plate {
  border-color: var(--or);
  box-shadow: 0 0 0 1px rgba(242, 212, 136, .7) inset, 0 0 22px rgba(255, 215, 106, .2), 0 6px 16px rgba(0, 0, 0, .45);
}
.gate-slot__plate strong { font-family: var(--font-display); font-size: 15.5px; color: var(--encre); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-slot__plate span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--braise-deep); font-weight: 700; }
.gate-slot__plate em { font-style: normal; font-size: 10px; color: var(--encre-soft); }

.gate-slot__delete {
  position: absolute; top: 6px; right: 6px;
  width: 21px; height: 21px; display: grid; place-items: center;
  border: 1px solid rgba(143, 36, 23, .5); border-radius: 50%;
  color: #8f2417; font-size: 13px; font-weight: 900; line-height: 1;
  background: rgba(255, 251, 238, .8); cursor: pointer;
  opacity: .55; transition: opacity .15s, transform .15s;
}
.gate-slot__plate:hover .gate-slot__delete, .gate-slot__delete:focus-visible { opacity: 1; }
.gate-slot__delete:hover { transform: scale(1.12); }

/* Emplacement libre */
.gate-slot--empty .gate-slot__select { opacity: .8; }
.gate-slot--empty .gate-slot__select:hover { opacity: 1; }
.gate-slot__plus {
  position: relative; z-index: 2; margin-bottom: 8px;
  width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 50%; font-size: 30px; font-weight: 400; color: rgba(244, 233, 205, .75);
  border: 2px dashed rgba(217, 166, 63, .45);
  background: rgba(20, 26, 22, .5);
  transition: border-color .18s, color .18s, box-shadow .18s;
}
.gate-slot--empty .gate-slot__select:hover .gate-slot__plus {
  border-color: var(--lueur); color: var(--lueur);
  box-shadow: 0 0 20px rgba(255, 215, 106, .2);
}
.gate-slot--empty .gate-slot__pedestal i { filter: saturate(.45) brightness(.8); }
.gate-slot--empty .gate-slot__pedestal b { opacity: .4; }
.gate-slot--empty .gate-slot__plate { opacity: .78; filter: saturate(.7); }
.gate-slot--empty .gate-slot__plate span { color: var(--encre-soft); }

/* ==========================================================================
   ÉCRAN 5 — CRÉATION DE PERSONNAGE
   ========================================================================== */
.gate-creator__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 430px);
  gap: clamp(14px, 2vw, 22px);
  max-width: 1180px; margin: 0 auto clamp(12px, 2.4vh, 20px);
  align-items: stretch;
}

.gate-creator__classes { display: flex; flex-direction: column; gap: 14px; }
.gate-creator__classes .gate-card__title { margin-bottom: 2px; }
.gate-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  align-content: start;
  gap: 10px;
}
.gate-creator__classes .gate-classlore { margin-top: auto; }

.gate-class {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px 9px 8px; border-radius: 12px;
  text-align: left; cursor: pointer;
  border: 2px solid rgba(74, 56, 38, .3);
  background: linear-gradient(180deg, rgba(255, 251, 238, .75), rgba(233, 217, 179, .75));
  transition: transform .15s var(--ease-out), border-color .15s, box-shadow .15s, background .15s;
}
.gate-class:hover { transform: translateY(-2px); border-color: rgba(185, 84, 0, .5); }
.gate-class.is-selected {
  border-color: var(--braise);
  background: linear-gradient(180deg, #fff3df, #fbe3bd);
  box-shadow: 0 0 0 3px rgba(246, 139, 31, .2), 0 4px 12px rgba(74, 56, 38, .22);
}
.gate-class__portrait {
  flex: none; width: 50px; height: 50px; overflow: hidden;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(74, 56, 38, .35);
  background: radial-gradient(circle at 40% 32%, #dff0d2, #a8cf98 70%, #79a56c);
  box-shadow: inset 0 -5px 8px rgba(47, 82, 40, .3);
}
.gate-class.is-selected .gate-class__portrait { border-color: var(--braise); }
.gate-class__portrait img { height: 82px; width: 44px; object-fit: contain; object-position: top center; margin-top: 8px; }
.gate-class__text { display: grid; line-height: 1.12; min-width: 0; }
.gate-class__text strong { font-size: 13px; color: var(--encre); }
.gate-class__text small { font-size: 10px; color: var(--encre-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Studio d'aperçu */
.gate-creator__studio { display: grid; gap: 13px; }

.gate-studio {
  position: relative;
  min-height: 224px;
  display: grid; place-items: end center;
  padding-bottom: 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(74, 56, 38, .4);
  background:
    radial-gradient(120% 90% at 50% 112%, #2c5a3a 0%, transparent 55%),
    linear-gradient(180deg, #142530, #182f2b 70%, #16281f);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .45);
}
.gate-studio__rays {
  position: absolute; top: -34%; left: 50%; transform: translateX(-50%);
  width: 150%; aspect-ratio: 1;
  background: conic-gradient(from 0deg,
    transparent 0 14deg, rgba(255, 215, 106, .06) 14deg 26deg,
    transparent 26deg 42deg, rgba(255, 215, 106, .05) 42deg 54deg,
    transparent 54deg 74deg, rgba(255, 215, 106, .06) 74deg 86deg,
    transparent 86deg 104deg, rgba(255, 215, 106, .05) 104deg 118deg,
    transparent 118deg 138deg, rgba(255, 215, 106, .06) 138deg 150deg,
    transparent 150deg 172deg, rgba(255, 215, 106, .05) 172deg 184deg,
    transparent 184deg 360deg);
  animation: gate-rays 40s linear infinite;
}
@keyframes gate-rays { to { transform: translateX(-50%) rotate(360deg); } }

.gate-studio img[data-character-preview] {
  position: relative; z-index: 2;
  width: min(220px, 80%); height: 176px;
  object-fit: contain; object-position: bottom center;
  margin-bottom: 12px;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .55));
}
.gate-slot__pedestal--studio { left: 24%; right: 24%; height: 30px; bottom: 8px; }

.gate-studio__turn {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; font-size: 16px; color: var(--or-clair); cursor: pointer;
  border: 1px solid rgba(217, 166, 63, .45);
  background: rgba(20, 14, 7, .7);
  transition: transform .16s var(--ease-out);
}
.gate-studio__turn:hover { transform: rotate(-30deg); }

.gate-studio__label {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  display: grid; line-height: 1.1;
}
.gate-studio__label strong { font-family: var(--font-display); font-size: 19px; color: var(--parchemin); text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.gate-studio__label small { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--lueur); }

.gate-classlore {
  display: grid; gap: 3px;
  padding: 10px 13px; border-radius: 11px;
  border: 1px solid rgba(74, 56, 38, .3);
  background: rgba(255, 251, 238, .55);
}
.gate-classlore b { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--braise-deep); }
.gate-classlore p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--encre); }

/* Couleurs */
.gate-colors { margin: 0; padding: 12px 13px 13px; border: 2px solid rgba(74, 56, 38, .3); border-radius: 12px; display: grid; gap: 11px; }
.gate-colors legend {
  padding: 0 8px; margin-left: -4px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--encre-soft);
}
.gate-colors__wells { display: flex; gap: 14px; }
.gate-colorwell { display: grid; gap: 5px; justify-items: center; cursor: pointer; }
.gate-colorwell input[type="color"] {
  appearance: none; -webkit-appearance: none;
  width: 46px; height: 46px; padding: 0; cursor: pointer;
  border: 3px solid var(--cuir); border-radius: 50%;
  background: none;
  box-shadow: 0 0 0 2px rgba(242, 212, 136, .55), 0 3px 8px rgba(74, 56, 38, .3);
  transition: transform .15s var(--ease-out);
}
.gate-colorwell input[type="color"]:hover { transform: scale(1.08); }
.gate-colorwell input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.gate-colorwell input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.gate-colorwell input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.gate-colorwell span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-soft); font-weight: 700; }

.gate-colors__presets { display: flex; flex-wrap: wrap; gap: 7px; }
.gate-preset {
  display: inline-flex; align-items: stretch; overflow: hidden;
  width: 54px; height: 24px; padding: 0;
  border: 2px solid rgba(74, 56, 38, .45); border-radius: 999px;
  cursor: pointer;
  transition: transform .14s var(--ease-out), border-color .14s, box-shadow .14s;
}
.gate-preset span { flex: 1; height: 100%; }
.gate-preset:hover { transform: translateY(-2px); border-color: var(--braise); box-shadow: 0 3px 9px rgba(74, 56, 38, .3); }

.gate-actionbar--creator { justify-content: space-between; max-width: 1180px; margin: 0 auto; }

/* ==========================================================================
   BADGE EN JEU (affiché une fois la partie lancée)
   ========================================================================== */
.in-game-account-badge {
  position: fixed; z-index: 50000; top: 8px; right: 8px;
  display: flex; align-items: center; gap: 9px;
  padding: 6px 7px 6px 12px;
  border: 1px solid rgba(217, 166, 63, .5); border-radius: 12px;
  color: #f4e9cd;
  background: linear-gradient(180deg, rgba(58, 44, 26, .95), rgba(30, 21, 11, .95));
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
  font-family: 'Trebuchet MS', Arial, sans-serif;
  opacity: .88; transition: opacity .15s;
}
.in-game-account-badge:hover { opacity: 1; }
.in-game-account-badge span { display: grid; line-height: 1.1; }
.in-game-account-badge small { color: #d9a63f; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.in-game-account-badge strong { max-width: 160px; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; white-space: nowrap; }
.in-game-account-badge button {
  width: 27px; height: 27px; display: grid; place-items: center;
  border: 1px solid rgba(242, 212, 136, .55); border-radius: 50%;
  color: #fff8ea; cursor: pointer; font-size: 13px;
  background: linear-gradient(180deg, #f68b1f, #b95400);
}
.in-game-account-badge button:hover { filter: brightness(1.12); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1060px) {
  .gate-login { grid-template-columns: 1fr; gap: 22px; }
  .gate-login__panel { width: min(440px, 100%); justify-self: center; }
  .gate-login__crest { min-height: 200px; }
  .gate-creator__grid { grid-template-columns: 1fr; }
  .gate-trail { display: none; }
}

@media (max-width: 640px) {
  .gate-frame { padding: 12px 12px 14px; }
  .gate-brand__word small { display: none; }
  .gate-chip { display: none; }
  .gate-form__row { grid-template-columns: 1fr; }
  .gate-register__card { padding-top: 48px; }
  .gate-register__actions { flex-direction: column-reverse; }
  .gate-register__actions .gate-btn { width: 100%; }
  .gate-slot-stage { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .gate-actionbar { flex-direction: column; }
  .gate-actionbar .gate-btn { width: 100%; max-width: 340px; }
  .gate-actionbar--creator { flex-direction: column-reverse; text-align: center; }
  .gate-sky__moon { width: 64px; height: 64px; top: 4%; right: 5%; }
  .gate-footer { flex-direction: column; gap: 4px; text-align: center; }
  .gate-footer i { display: none; }
  .gate-roster { display: none; }
}

/* ==========================================================================
   ACCESSIBILITÉ — mouvement réduit
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .gate-screen,
  .gate-sky__stars, .gate-sky__stars--far,
  .gate-firefly,
  .gate-egg--hero, .gate-egg__halo,
  .gate-studio__rays,
  .gate-slot.is-selected .gate-slot__aura {
    animation: none !important;
  }
  .gate-firefly { opacity: .5; }
  .gate-screen { opacity: 1; transform: none; }
  .account-gate * { transition-duration: .01ms !important; }
}


/* ============================================================
   Écran de préchargement au démarrage (« La veillée s'éveille »)
   ============================================================ */
.gate-boot {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--nuit-0) 0%, var(--nuit-1) 46%, var(--nuit-2) 74%, var(--horizon) 100%);
}
.gate-boot__sky { position: absolute; inset: 0; pointer-events: none; }
.gate-boot__stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.1px 1.1px at 31% 9%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(1.6px 1.6px at 47% 28%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.1px 1.1px at 63% 12%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.4px 1.4px at 78% 24%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1.1px 1.1px at 89% 8%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 22% 44%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.2px 1.2px at 71% 41%, rgba(255,255,255,.55), transparent 60%);
  animation: gate-boot-twinkle 5s ease-in-out infinite alternate;
}
@keyframes gate-boot-twinkle { from { opacity: .65; } to { opacity: 1; } }
.gate-boot__moon {
  position: absolute; top: 7%; right: 9%;
  width: clamp(64px, 8vw, 104px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff6da, #f0dfae 58%, #d9c184);
  box-shadow: 0 0 44px rgba(255, 240, 200, .4), 0 0 120px rgba(255, 240, 200, .16);
}
.gate-boot__hills {
  position: absolute; left: -10%; right: -10%; bottom: -4%; height: 34%;
  background:
    radial-gradient(58% 88% at 22% 100%, #1d4038 0 62%, transparent 63%),
    radial-gradient(64% 96% at 74% 100%, #173129 0 66%, transparent 67%),
    radial-gradient(120% 120% at 50% 118%, #122820 0 70%, transparent 71%);
}
.gate-boot__panel {
  position: relative; z-index: 1;
  display: grid; justify-items: center; gap: 10px;
  width: min(430px, calc(100vw - 48px));
  text-align: center;
  animation: gate-boot-rise .6s var(--ease-out) both;
}
@keyframes gate-boot-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.gate-boot__egg {
  width: 66px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .5)) drop-shadow(0 0 22px rgba(89, 182, 74, .25));
  animation: gate-boot-float 3.2s ease-in-out infinite alternate;
}
@keyframes gate-boot-float { from { transform: translateY(0); } to { transform: translateY(-7px); } }
.gate-boot__title {
  margin: 2px 0 0;
  font-family: var(--font-display); font-size: 34px; letter-spacing: .01em;
  color: var(--parchemin); text-shadow: 0 3px 14px rgba(0, 0, 0, .55);
}
.gate-boot__title em { font-style: normal; color: var(--or-clair); }
.gate-boot__subtitle {
  margin: -4px 0 8px;
  font-size: 12.5px; letter-spacing: .08em;
  color: rgba(244, 233, 205, .62);
}
.gate-boot__bar {
  position: relative;
  width: 100%; height: 16px;
  border-radius: 999px; overflow: hidden;
  border: 2px solid rgba(217, 166, 63, .5);
  background: linear-gradient(180deg, rgba(9, 14, 19, .85), rgba(20, 28, 24, .85));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 4px 16px rgba(0, 0, 0, .35);
}
.gate-boot__fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffcf7d 0%, var(--braise) 55%, var(--braise-deep) 100%);
  box-shadow: 0 0 14px rgba(246, 139, 31, .55);
  transition: width .3s var(--ease-out);
}
.gate-boot__spark {
  position: absolute; inset: 2px; pointer-events: none; border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .22) 48%, transparent 100%);
  background-size: 180px 100%; background-repeat: no-repeat;
  animation: gate-boot-sheen 1.6s linear infinite;
  mix-blend-mode: screen;
}
@keyframes gate-boot-sheen { from { background-position: -180px 0; } to { background-position: calc(100% + 180px) 0; } }
.gate-boot__meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  width: 100%;
  font-size: 11.5px; color: rgba(244, 233, 205, .7);
}
.gate-boot__stage {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: .04em; text-align: left;
}
.gate-boot__percent {
  flex: none;
  font-family: var(--font-display); font-size: 15px; color: var(--or-clair);
}
.gate-boot__skip {
  margin-top: 10px; padding: 6px 12px;
  font-size: 11.5px; letter-spacing: .05em;
  color: rgba(244, 233, 205, .55);
  background: none; border: none; cursor: pointer;
  border-bottom: 1px dashed rgba(244, 233, 205, .3);
  transition: color .15s;
}
.gate-boot__skip:hover { color: var(--or-clair); }
@media (prefers-reduced-motion: reduce) {
  .gate-boot__stars, .gate-boot__egg, .gate-boot__spark { animation: none; }
}

/* ==========================================================================
   ECLIPSE — mondes privés multijoueur intégrés au flux de connexion
   ========================================================================== */
.gate-mp-hub,
.gate-mp-manage {
  width: min(1120px, calc(100vw - 42px));
  margin: 0 auto;
}

.gate-mp-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 auto 18px;
  max-width: 880px;
}
.gate-mp-action {
  min-height: 104px;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 15px 17px;
  text-align: left;
  color: var(--parchemin);
  border: 2px solid rgba(217, 166, 63, .42);
  border-radius: 16px;
  background:
    radial-gradient(100% 160% at 10% 0%, rgba(89,182,74,.12), transparent 56%),
    linear-gradient(180deg, rgba(28,49,48,.96), rgba(18,29,29,.96));
  box-shadow: 0 12px 30px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.05);
  cursor: pointer;
  transition: transform .18s var(--ease-out), border-color .18s, box-shadow .18s, background .18s;
}
.gate-mp-action:hover {
  transform: translateY(-3px);
  border-color: var(--or-clair);
  box-shadow: 0 16px 34px rgba(0,0,0,.38), 0 0 24px rgba(217,166,63,.12);
}
.gate-mp-action > span {
  grid-row: 1 / 3;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid rgba(242,212,136,.4);
  border-radius: 50%;
  color: var(--lueur);
  font-family: var(--font-display); font-size: 21px;
  background: rgba(10,22,28,.72);
  box-shadow: inset 0 0 14px rgba(217,166,63,.1);
}
.gate-mp-action strong { align-self: end; font-family: var(--font-display); font-size: 19px; color: #fff5dc; }
.gate-mp-action small { align-self: start; margin-top: 2px; color: rgba(244,233,205,.55); font-size: 11px; }
.gate-mp-action--create { border-color: rgba(246,139,31,.55); }
.gate-mp-action--create > span { color: #ffb356; border-color: rgba(246,139,31,.55); }
.gate-mp-action--mine > span { color: #b7dca8; }

.gate-mp-serverlist {
  display: grid;
  gap: 10px;
  width: min(960px, 100%);
  max-height: min(44vh, 430px);
  margin: 0 auto;
  padding: 14px;
  overflow: auto;
  border: 1px solid rgba(217,166,63,.32);
  border-radius: 18px;
  background: rgba(7,16,18,.58);
  box-shadow: inset 0 10px 35px rgba(0,0,0,.24), 0 12px 36px rgba(0,0,0,.22);
  scrollbar-color: rgba(217,166,63,.45) transparent;
}
.gate-mp-serverlist__title {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 3px 8px;
  border-bottom: 1px solid rgba(217,166,63,.15);
}
.gate-mp-serverlist__title > span { display: flex; align-items: baseline; gap: 10px; }
.gate-mp-serverlist__title small { color: var(--or); letter-spacing: .17em; font-size: 9px; }
.gate-mp-serverlist__title strong { font-size: 12px; color: rgba(244,233,205,.72); }
.gate-mp-serverlist__title em { font-style: normal; font-size: 11px; color: rgba(244,233,205,.5); }

.gate-mp-world {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(217,166,63,.25);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(22,42,40,.96), rgba(14,25,27,.94));
  transition: border-color .16s, transform .16s, background .16s;
}
.gate-mp-world:hover { border-color: rgba(242,212,136,.52); transform: translateX(2px); }
.gate-mp-world.is-owner { background: linear-gradient(90deg, rgba(45,48,31,.98), rgba(18,28,27,.95)); }
.gate-mp-world__crest { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; }
.gate-mp-world__crest .gate-egg--orb { width: 56px; }
.gate-mp-world__body { min-width: 0; display: grid; gap: 2px; }
.gate-mp-world__role { color: var(--or); font-size: 8px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.gate-mp-world__body > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 19px; color: #fff5dc; }
.gate-mp-world__body > small { color: rgba(244,233,205,.52); font-size: 10.5px; }
.gate-mp-rates { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.gate-mp-rates span {
  padding: 3px 7px; border: 1px solid rgba(217,166,63,.2); border-radius: 999px;
  color: #e9d9b3; background: rgba(0,0,0,.18); font-size: 9px; font-weight: 700;
}
.gate-mp-world__actions { display: flex; align-items: center; gap: 7px; }
.gate-btn--small { padding: 8px 13px; border-radius: 10px; font-size: 11px; }
.gate-btn--danger {
  color: #fff4ee;
  border: 2px solid #762c20;
  background: linear-gradient(180deg, #da5b45, #8d2e22);
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 5px 16px rgba(80,14,8,.3);
}
.gate-btn--danger:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.gate-card .gate-btn--danger { color: #fff4ee; }

.gate-mp-empty {
  min-height: 125px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 20px; text-align: left;
  border: 1px dashed rgba(217,166,63,.3); border-radius: 14px;
  color: rgba(244,233,205,.62); background: rgba(4,12,14,.2);
}
.gate-mp-empty > span { width: 70px; opacity: .65; }
.gate-mp-empty .gate-egg--orb { width: 68px; }
.gate-mp-empty strong { display: block; margin-bottom: 4px; color: var(--parchemin); font-family: var(--font-display); font-size: 17px; }
.gate-mp-empty p { margin: 0; font-size: 11px; }

.gate-mp-link { width: min(720px, 100%); margin: 0 auto; display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: center; }
.gate-mp-link__identity { display: grid; gap: 4px; padding: 16px; border-radius: 14px; color: var(--encre); background: rgba(255,255,255,.24); border: 1px solid rgba(74,56,38,.18); }
.gate-mp-link__identity small { text-transform: uppercase; letter-spacing: .14em; font-size: 9px; color: var(--encre-soft); }
.gate-mp-link__identity strong { font-family: var(--font-display); font-size: 22px; }
.gate-mp-link__identity span { font-size: 11px; color: var(--encre-soft); }

.gate-mp-modal {
  position: fixed; inset: 0; z-index: 25;
  display: grid; place-items: center;
  padding: 24px;
}
.gate-mp-modal__backdrop { position: absolute; inset: 0; border: 0; background: rgba(2,8,10,.78); backdrop-filter: blur(7px); cursor: default; }
.gate-mp-modal__panel {
  position: relative; z-index: 1;
  width: min(560px, calc(100vw - 34px)); max-height: min(86vh, 760px); overflow: auto;
  animation: gate-screen-in .22s var(--ease-out) both;
}
.gate-mp-modal__close {
  position: absolute; z-index: 3; top: 10px; right: 12px;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(74,56,38,.4);
  color: var(--encre); background: rgba(255,251,238,.6); cursor: pointer; font-size: 18px;
}
.gate-mp-createform,
.gate-mp-joinform { margin-top: 7px; }
.gate-mp-rategrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gate-mp-check { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 11px; border: 1px solid rgba(74,56,38,.25); background: rgba(255,255,255,.22); }
.gate-mp-check input { width: 18px; height: 18px; accent-color: var(--braise); }
.gate-mp-check span { display: grid; gap: 2px; }
.gate-mp-check b { color: var(--encre); font-size: 12px; }
.gate-mp-check small { color: var(--encre-soft); font-size: 10px; }

.gate-mp-manage { align-content: start; padding-top: clamp(4px, 2vh, 22px); }
.gate-mp-manage .gate-heading { margin-bottom: 15px; }
.gate-mp-manage__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 14px;
  max-height: min(59vh, 620px);
  overflow: auto;
  padding: 2px 5px 14px 2px;
  scrollbar-color: rgba(217,166,63,.45) transparent;
}
.gate-mp-settings { grid-row: span 2; }
.gate-mp-members { grid-column: 1 / -1; }
.gate-mp-readonly { display: grid; gap: 8px; }
.gate-mp-readonly p { margin: 0; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.25); }
.gate-mp-code { display: grid; gap: 8px; margin-bottom: 14px; }
.gate-mp-code > span { color: var(--encre-soft); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.gate-mp-code > strong {
  padding: 12px 14px; border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 19px; letter-spacing: .14em; text-align: center;
  color: #4b3414; background: rgba(255,255,255,.38); border: 1px dashed rgba(74,56,38,.45);
  user-select: all;
}
.gate-mp-simplelist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.gate-mp-simplelist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 6px 8px; border-radius: 9px; background: rgba(255,255,255,.22); font-size: 11px; }
.gate-mp-simplelist li:only-child em { width: 100%; text-align: center; color: var(--encre-soft); }
.gate-mini { padding: 5px 8px; border: 1px solid rgba(74,56,38,.32); border-radius: 8px; background: rgba(255,255,255,.45); color: var(--encre); cursor: pointer; font-size: 9px; font-weight: 700; }
.gate-mini:hover { background: rgba(255,255,255,.72); }
.gate-mini--danger { color: #8d2e22; border-color: rgba(141,46,34,.35); }
.gate-mp-tablewrap { overflow: auto; border: 1px solid rgba(74,56,38,.2); border-radius: 10px; }
.gate-mp-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.gate-mp-table th { padding: 8px; text-align: left; color: var(--encre-soft); text-transform: uppercase; letter-spacing: .08em; font-size: 8px; background: rgba(74,56,38,.08); }
.gate-mp-table td { padding: 8px; border-top: 1px solid rgba(74,56,38,.12); vertical-align: middle; }
.gate-mp-table td:last-child { text-align: right; white-space: nowrap; }
.gate-mp-table strong { color: var(--encre); }
.gate-mp-table em { color: var(--encre-soft); font-style: normal; }

@media (max-width: 820px) {
  .gate-mp-actions { grid-template-columns: 1fr; }
  .gate-mp-action { min-height: 76px; }
  .gate-mp-world { grid-template-columns: 52px 1fr; }
  .gate-mp-world__crest { width: 50px; height: 50px; }
  .gate-mp-world__crest .gate-egg--orb { width: 48px; }
  .gate-mp-world__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .gate-mp-manage__grid { grid-template-columns: 1fr; max-height: none; }
  .gate-mp-settings, .gate-mp-members { grid-column: auto; grid-row: auto; }
  .gate-mp-link { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .gate-mp-hub, .gate-mp-manage { width: 100%; }
  .gate-mp-rategrid { grid-template-columns: 1fr; }
  .gate-mp-world { grid-template-columns: 1fr; text-align: center; }
  .gate-mp-world__crest { justify-self: center; }
  .gate-mp-rates, .gate-mp-world__actions { justify-content: center; }
  .gate-mp-serverlist__title { align-items: flex-start; flex-direction: column; }
}
