/* =========================================================
   ECARLATERP — THÈME ROUGE ÉCARLATE
   ========================================================= */
:root {
  --bg:        #0a0c11;
  --bg-alt:    #0e1117;
  --card:      #141821;
  --card-hi:   #1a1f2b;
  --border:    #242a36;
  --text:      #eef1f6;
  --muted:     #9aa4b4;
  --accent:    #e0392b;   /* rouge écarlate */
  --accent-2:  #ff5240;   /* rouge clair (glow) */
  --accent-dk: #b62a20;   /* rouge foncé (hover) */
  --glow:      0 0 26px rgba(224, 57, 43, .45);
  --radius:    14px;
  --maxw:      1140px;
  /* Police du titre "EcarlateRP" — change juste cette ligne (+ le <link> dans index.html) pour tester une autre police */
  --title-font: "Oswald", "Poppins", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Poppins", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }

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

.hl { color: var(--accent); }

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .9em;
  background: rgba(224, 57, 43, .12);
  color: var(--accent-2);
  padding: .2em .5em;
  border-radius: 6px;
}

/* ===================== NAVBAR ===================== */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(10, 12, 17, .9);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: 0 48px;
}
.nav-collapse { display: flex; flex: 1; align-items: center; justify-content: space-between; margin-left: 8px; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 30px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .98rem;
  letter-spacing: .2px;
  opacity: .92;
  transition: color .2s, opacity .2s;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.nav-link:hover { color: var(--accent-2); opacity: 1; }
.nav-link.active { color: var(--accent-2); }
.nav-link .ico {
  width: 19px; height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-cta {
  background: var(--accent);
  padding: 9px 20px;
  border-radius: 9px;
  text-shadow: none;
  box-shadow: 0 4px 14px rgba(224,57,43,.35);
}
.nav-cta:hover { background: var(--accent-dk); color: #fff; }

/* État connecté */
.nav-user { display: flex; align-items: center; gap: 14px; }
.nav-user-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  font-size: .98rem;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
  transition: color .2s;
}
.nav-user-name:hover { color: var(--accent-2); }
.nav-user-name svg {
  width: 19px; height: 19px;
  fill: none; stroke: var(--accent-2); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  padding: 7px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.nav-logout:hover { background: var(--accent); border-color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 26px; height: 3px; border-radius: 3px; background: #fff;
  transition: transform .3s, opacity .3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===================== HERO ===================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: url("../img/background.jpg") center/cover no-repeat;
  background-attachment: fixed;
  padding: 100px 24px 60px;
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(8,10,16,.15), rgba(8,10,16,.7) 100%),
    linear-gradient(180deg, rgba(8,10,16,.55) 0%, rgba(8,10,16,.1) 30%, rgba(8,10,16,.85) 100%);
}
.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-logo {
  width: clamp(150px, 22vw, 240px);
  height: auto;
  filter: drop-shadow(0 8px 30px rgba(224,57,43,.45));
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.hero-name {
  font-family: var(--title-font);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
  line-height: 1;
  margin: 10px 0 30px;
  text-shadow: 0 4px 30px rgba(224,57,43,.5);
}

/* Bouton launcher */
.btn-launcher {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.08rem;
  text-decoration: none;
  padding: 15px 34px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(224,57,43,.14);
  transition: transform .15s, background .2s, box-shadow .2s;
}
.btn-launcher:hover {
  background: var(--accent-dk);
  transform: translateY(-2px);
  box-shadow: 0 3px 9px rgba(224,57,43,.2);
}
.btn-launcher:active { transform: translateY(0); }
.ico-dl {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Réseaux sociaux */
.socials { display: flex; gap: 16px; margin-top: 30px; }
.social {
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(20, 24, 33, .65);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  backdrop-filter: blur(4px);
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
}
.social svg { width: 22px; height: 22px; }
.social:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}

/* Pastille statut (affichée seulement si en ligne) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(20, 24, 33, .6);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(4px);
  font-size: .9rem;
  font-weight: 600;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 0 rgba(61,220,132,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61,220,132,.6); }
  70% { box-shadow: 0 0 0 9px rgba(61,220,132,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); }
}

.scroll-hint {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 1.4rem;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ===================== SECTIONS ===================== */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.5px;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin: 12px auto 52px;
  max-width: 560px;
}

/* ===================== CARDS ===================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.card-icon { font-size: 2.3rem; margin-bottom: 14px; }
.card h3 { font-size: 1.22rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .96rem; }

/* ===================== STEPS ===================== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
}
.step-num {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 1.3rem;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(224,57,43,.35);
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .96rem; }
.join-cta { text-align: center; margin-top: 46px; }

/* ===================== LEADERBOARD ===================== */
.board { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin: 0 auto; }
.board-row {
  display: flex; align-items: center; gap: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 20px;
  transition: border-color .2s, transform .2s;
}
.board-row:hover { border-color: var(--accent); transform: translateX(4px); }
.board-rank { font-weight: 800; font-size: 1.2rem; width: 40px; color: var(--muted); }
.board-row.top1 .board-rank,
.board-row.top2 .board-rank,
.board-row.top3 .board-rank { color: var(--accent-2); }
.board-avatar {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--card-hi); image-rendering: pixelated;
}
.board-name { font-weight: 700; flex: 1; }
.board-score { color: var(--accent-2); font-weight: 600; font-size: .95rem; }

/* ===================== GALLERY ===================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.gallery-item {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; color: rgba(255,255,255,.22);
  background: var(--card);
}

/* ===================== FAQ ===================== */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.faq-q {
  width: 100%; text-align: left;
  background: none; border: none; color: var(--text);
  font-family: inherit; font-size: 1.05rem; font-weight: 600;
  padding: 20px 22px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-q .chev { transition: transform .25s; color: var(--accent); }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  color: var(--muted); padding: 0 22px;
}
.faq-item.open .faq-a { padding: 0 22px 20px; max-height: 320px; }

/* ===================== FOOTER ===================== */
.footer { background: #07090d; border-top: 1px solid var(--border); padding: 48px 0 30px; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: space-between; align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-logo { width: 48px; height: 48px; }
.brand-name { font-weight: 800; font-size: 1.2rem; }
.footer-tag { color: var(--muted); font-size: .88rem; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--accent-2); }
.footer-copy {
  text-align: center; color: var(--muted); font-size: .82rem;
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border);
}

/* ===================== REVEAL ===================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s, transform .6s; }
.reveal.visible { opacity: 1; transform: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .nav-inner { padding: 0 22px; }
  .nav-toggle { display: flex; }
  .nav-collapse {
    position: fixed;
    top: 74px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    background: rgba(10, 12, 17, .98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px 0 14px;
    transform: translateY(-135%);
    transition: transform .35s ease;
  }
  .nav-collapse.open { transform: translateY(0); }
  .nav-left, .nav-right { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav-link { padding: 14px 24px; width: 100%; justify-content: flex-start; }
  .nav-cta { margin: 10px 24px 4px; width: calc(100% - 48px); justify-content: center; }
  .nav-user { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav-user-name { padding: 14px 24px; }
  .nav-logout { margin: 10px 24px; }
}

@media (max-width: 600px) {
  .hero { background-attachment: scroll; }
  .socials { gap: 12px; }
  .social { width: 46px; height: 46px; }
}

/* ===================== AUTH (connexion / inscription) ===================== */
.auth-wrap {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 110px 20px 60px;
  background: url("../img/background.jpg") center/cover no-repeat fixed;
}
.auth-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,10,16,.72), rgba(8,10,16,.9));
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 410px;
  background: rgba(18, 22, 30, .92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 32px 30px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  text-align: center;
}
.auth-logo { width: 62px; height: 62px; }
.auth-title {
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 1.9rem;
  color: #fff;
  margin-top: 8px;
}
.auth-sub { color: var(--muted); font-size: .92rem; margin-bottom: 22px; }

.field { text-align: left; margin-bottom: 15px; }
.field > label:not(.checkbox) {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  background: #0e1218;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: .98rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #586677; }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224,57,43,.16);
}
.field.invalid input { border-color: var(--accent); background: rgba(224,57,43,.06); }
.field-error {
  display: block;
  color: var(--accent-2);
  font-size: .78rem;
  margin-top: 5px;
  min-height: .9em;
}

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted);
  padding: 7px;
  display: flex;
}
.pass-toggle svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.pass-toggle:hover { color: var(--text); }
.pass-toggle.active { color: var(--accent-2); }

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px 0 20px;
  font-size: .85rem;
}
.checkbox { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.checkbox input { accent-color: var(--accent); width: 16px; height: 16px; }
.muted-link { color: var(--muted); text-decoration: none; }
.muted-link:hover { color: var(--accent-2); }

.btn-auth {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-auth:hover { background: var(--accent-dk); }
.btn-auth:active { transform: translateY(1px); }

.form-msg { font-size: .9rem; margin-top: 14px; min-height: 1.1em; }
.form-msg.ok { color: #3ddc84; }
.form-msg.err { color: var(--accent-2); }

.auth-switch { margin-top: 18px; font-size: .9rem; color: var(--muted); }
.auth-switch a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* Page compte */
.account-card { max-width: 440px; }
.account-avatar {
  width: 88px; height: 88px;
  border-radius: 16px;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  background: #0e1218;
}
.account-info {
  text-align: left;
  margin: 22px 0 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.account-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 13px 16px;
  font-size: .95rem;
}
.account-row + .account-row { border-top: 1px solid var(--border); }
.account-row span { color: var(--muted); }
.account-row strong { color: var(--text); font-weight: 600; word-break: break-all; text-align: right; }
.btn-ghost {
  display: block;
  text-align: center;
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--border);
  color: #fff;
  margin-bottom: 10px;
}
.btn-ghost:hover { background: rgba(255,255,255,.06); border-color: var(--accent); }

/* garde le bouton Inscription (CTA) lisible quand il est la page active */
.nav-cta.active { color: #fff; }

@media (max-width: 600px) {
  .auth-wrap { background-attachment: scroll; padding-top: 96px; }
  .auth-card { padding: 28px 22px; }
}
