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

:root {
  --gold:      #c8942a;
  --gold-light:#f0c050;
  --gold-dim:  rgba(200,148,42,0.3);
  --dark:      #06090f;
  --dark-blue: #080d18;
  --parchment: #e8dfc0;
  --text-dim:  rgba(232,223,192,0.45);
}

body {
  font-family: 'IM Fell English', Georgia, serif;
  background: var(--dark);
  color: var(--parchment);
  overflow-x: hidden;
}

/* ══ TOPBAR ══ */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 51;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 6px 48px;
  background: rgba(3,8,35,0.85);
  border-bottom: 1px solid var(--gold-dim);
  gap: 12px;
}
.auth-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem; letter-spacing: 3px; text-transform: uppercase;
  padding: 5px 18px; cursor: pointer; transition: all 0.3s;
  text-decoration: none;
}
.auth-btn.login  { color: var(--gold-light); background: none; border: 1px solid var(--gold-dim); }
.auth-btn.login:hover { border-color: var(--gold); background: rgba(200,148,42,0.08); }
.auth-btn.register { color: var(--dark); background: linear-gradient(135deg, var(--gold-light), var(--gold)); border: 1px solid transparent; }
.auth-btn.register:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(200,148,42,0.4); }

/* ══ NAVBAR ══ */
#navbar {
  position: fixed; top: 30px; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 48px;
  background: rgba(5,15,60,0.45);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-dim);
  transition: background 0.4s;
}
#nav-left { display: flex; flex-direction: column; gap: 2px; }
#nav-server-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.4rem; font-weight: 700; letter-spacing: 6px;
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(200,148,42,0.6), 0 0 60px rgba(200,148,42,0.2);
}
#nav-players { font-size: 0.65rem; letter-spacing: 2px; color: #4ade80; display: flex; align-items: center; gap: 6px; font-family: 'Cinzel', serif; }
.dot { width: 6px; height: 6px; background: #4ade80; border-radius: 50%; box-shadow: 0 0 8px #4ade80; animation: pulse 2s infinite; }
#nav-right { display: flex; align-items: center; gap: 40px; }
.nav-link {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem; letter-spacing: 4px; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none;
  cursor: pointer; position: relative; padding-bottom: 4px; transition: color 0.3s;
}
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: var(--gold); transition: width 0.3s; }
.nav-link:hover, .nav-link.active { color: var(--gold-light); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Dropdown */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown:hover .dropdown-menu { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: rgba(6,9,15,0.97); border: 1px solid var(--gold-dim);
  min-width: 220px; opacity: 0; pointer-events: none;
  transition: all 0.25s ease; z-index: 100; padding: 8px 0; margin-top: 14px;
}
.dropdown-menu::before { content: ''; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.dropdown-item {
  font-family: 'Cinzel', serif;
  display: block; padding: 10px 20px;
  font-size: 0.65rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none; cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.dropdown-item:hover { color: var(--gold-light); background: rgba(200,148,42,0.05); }

/* ══ PAGES ══ */
.page { display: none; }
.page.active { display: block; }

/* ══ HERO ══ */
#hero { position: relative; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#hero-bg {
  position: absolute; inset: 0;
  background-image: url('../img/map-odal.png');
  background-size: 140%; background-position: center;
  filter: blur(3px) brightness(1.1) saturate(1.15);
  transform: scale(1.08);
  transition: filter 2s ease, transform 2s ease;
}
#hero-bg.deblur { filter: blur(0px) brightness(1.25) saturate(1.4) contrast(1.15); transform: scale(1.08); }
#hero-content.fade-out { opacity: 0; pointer-events: none; }
#hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(10,40,120,0.45) 0%, rgba(10,40,120,0.1) 45%, rgba(10,40,120,0.4) 100%),
              radial-gradient(ellipse at center, transparent 35%, rgba(5,20,80,0.4) 100%);
}
.corner { position: absolute; width: 60px; height: 60px; z-index: 5; border-color: var(--gold); border-style: solid; opacity: 0.5; }
.corner-tl { top: 110px; left: 24px;  border-width: 2px 0 0 2px; }
.corner-tr { top: 110px; right: 24px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: 24px; left: 24px;  border-width: 0 0 2px 2px; }
.corner-br { bottom: 24px; right: 24px; border-width: 0 2px 2px 0; }
#hero-content { position: relative; z-index: 10; text-align: center; animation: fadeInUp 1.4s ease 0.3s both; transition: opacity 0.8s ease; }
.hero-eyebrow {
  font-family: 'Cinzel Decorative', serif;
  font-size: 3.8rem; font-weight: 700; letter-spacing: 8px; text-transform: uppercase;
  color: var(--gold-light); margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  text-shadow: 0 0 30px rgba(200,148,42,0.8), 0 2px 8px rgba(0,0,0,0.95);
}
.hero-eyebrow::before, .hero-eyebrow::after { content: ''; display: block; width: 50px; height: 1px; background: var(--gold); opacity: 0.5; }
#hero-content h2 { font-family: 'IM Fell English', serif; font-size: 1.5rem; font-style: italic; color: rgba(232,223,192,0.75); margin-bottom: 40px; letter-spacing: 3px; text-shadow: 0 2px 8px rgba(0,0,0,0.9); }
#join-btn {
  font-family: 'Cinzel', serif;
  display: inline-block; padding: 16px 52px;
  font-size: 0.8rem; letter-spacing: 5px; text-transform: uppercase;
  color: var(--dark); background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: none; cursor: pointer; transition: all 0.4s ease;
  box-shadow: 0 0 30px rgba(200,148,42,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative; overflow: hidden;
}
#join-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent); opacity: 0; transition: opacity 0.3s; }
#join-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 40px rgba(200,148,42,0.55); }
#join-btn:hover::before { opacity: 1; }

/* ══ DOWNLOAD ══ */
#download {
  width: 100vw; height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #06090f 0%, #091a40 100%); margin: 0; position: relative;
}
.divider { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; color: var(--gold); opacity: 0.5; font-size: 1.2rem; }
.divider::before, .divider::after { content: ''; display: block; width: 80px; height: 1px; background: var(--gold); }
#download h2 { font-family: 'Cinzel', serif; font-size: 1.6rem; letter-spacing: 8px; text-transform: uppercase; color: var(--parchment); margin-bottom: 28px; text-shadow: 0 0 30px rgba(200,148,42,0.3); }
#download-btn { font-family: 'Cinzel', serif; padding: 18px 64px; font-size: 0.85rem; letter-spacing: 5px; text-transform: uppercase; color: var(--dark); background: linear-gradient(135deg, var(--gold-light), var(--gold)); border: none; cursor: pointer; transition: all 0.3s; box-shadow: 0 0 40px rgba(200,148,42,0.3); }
#download-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 50px rgba(200,148,42,0.5); }

/* ══ PODIUM ══ */
#podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-top: 80px; position: relative; z-index: 1; }
.podium-player { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 220px; }
.podium-avatar { width: 80px; height: 80px; background: rgba(200,148,42,0.1); border: 2px solid var(--gold-dim); border-radius: 4px; }
.podium-avatar.rank-1 { width: 100px; height: 100px; border-color: var(--gold-light); box-shadow: 0 0 30px rgba(200,148,42,0.5); }
.podium-avatar.rank-2 { border-color: #c0c0c0; }
.podium-avatar.rank-3 { border-color: #cd7f32; }
.podium-name { font-family: 'Cinzel', serif; font-size: 1rem; letter-spacing: 2px; color: var(--parchment); text-align: center; }
.podium-title { font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); text-align: center; }
.podium-block { width: 100%; display: flex; align-items: center; justify-content: center; border-top: 2px solid; }
.podium-block.rank-1 { height: 140px; background: rgba(200,148,42,0.12); border-color: var(--gold); }
.podium-block.rank-2 { height: 100px; background: rgba(192,192,192,0.08); border-color: #c0c0c0; }
.podium-block.rank-3 { height: 70px; background: rgba(205,127,50,0.08); border-color: #cd7f32; }
.podium-rank { font-family: 'Cinzel Decorative', serif; font-size: 2rem; font-weight: 700; }
.podium-rank.rank-1 { color: var(--gold-light); text-shadow: 0 0 20px rgba(200,148,42,0.6); }
.podium-rank.rank-2 { color: #c0c0c0; }
.podium-rank.rank-3 { color: #cd7f32; }
.podium-section-title { font-family: 'Cinzel Decorative', serif; font-size: 1.4rem; letter-spacing: 6px; text-transform: uppercase; color: var(--gold-light); margin-top: 80px; margin-bottom: 60px; display: flex; align-items: center; gap: 20px; justify-content: center; text-shadow: 0 0 30px rgba(200,148,42,0.4); }
.podium-section-title::before, .podium-section-title::after { content: ''; display: block; width: 60px; height: 1px; background: var(--gold); opacity: 0.4; }

/* ══ CINÉMATIQUE ══ */
#cinematic { display: none; position: fixed; inset: 0; background: radial-gradient(ellipse at center, #06090f 0%, #000 100%); z-index: 100; align-items: center; justify-content: center; flex-direction: column; }
#cinematic.active { display: flex; }
.cine-text { font-family: 'Cinzel', serif; font-size: 1.8rem; letter-spacing: 6px; text-transform: uppercase; color: var(--parchment); text-align: center; opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s ease; margin: 10px 0; }
.cine-text.visible { opacity: 1; transform: translateY(0); }
.cine-text.sub { font-family: 'IM Fell English', serif; font-style: italic; font-size: 1rem; letter-spacing: 3px; text-transform: none; color: var(--text-dim); }
.cine-text.gold { font-family: 'Cinzel Decorative', serif; color: var(--gold-light); font-size: 2.4rem; text-shadow: 0 0 40px rgba(200,148,42,0.8), 0 0 80px rgba(200,148,42,0.3); }
#skip-btn { font-family: 'Cinzel', serif; position: fixed; bottom: 40px; right: 40px; font-size: 0.65rem; letter-spacing: 4px; text-transform: uppercase; color: var(--text-dim); cursor: pointer; border: 1px solid var(--gold-dim); padding: 8px 20px; transition: all 0.3s; background: none; }
#skip-btn:hover { color: var(--gold-light); border-color: var(--gold); }

/* ══ LEADERBOARD ══ */
.community-header { text-align: center; padding: 56px 40px 36px; border-bottom: 1px solid var(--gold-dim); }
.community-header h1 { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 8px; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.community-header h2 { font-family: 'Cinzel Decorative', serif; font-size: 1.8rem; letter-spacing: 4px; color: var(--parchment); text-shadow: 0 0 30px rgba(200,148,42,0.25); }
.leaderboard { width: 100%; max-width: 920px; margin: 32px auto 0; }
.lb-row { display: grid; align-items: center; padding: 14px 24px; border-bottom: 1px solid rgba(200,148,42,0.08); transition: background 0.2s; }
.lb-row:hover { background: rgba(200,148,42,0.04); }
.lb-row.header { font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); opacity: 0.6; border-bottom: 1px solid var(--gold-dim); padding-bottom: 10px; }
.lb-islands { grid-template-columns: 48px 1fr 140px 160px 80px; }
.lb-players { grid-template-columns: 48px 1fr 80px 160px 130px; }
.lb-rank { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: rgba(232,223,192,0.2); }
.lb-rank.gold-rank   { color: var(--gold-light); text-shadow: 0 0 12px rgba(200,148,42,0.5); }
.lb-rank.silver-rank { color: #c8c8c8; }
.lb-rank.bronze-rank { color: #b07840; }
.lb-name { font-size: 0.9rem; letter-spacing: 1px; color: var(--parchment); }
.lb-sub  { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); }

.resource-tag { font-family: 'Cinzel', serif; display: inline-block; padding: 3px 10px; font-size: 0.6rem; letter-spacing: 2px; text-transform: uppercase; border-radius: 1px; }
.res-fer      { background: rgba(180,180,180,0.1); color: #b4b4b4; border: 1px solid rgba(180,180,180,0.25); }
.res-or       { background: rgba(200,148,42,0.12); color: var(--gold-light); border: 1px solid rgba(200,148,42,0.35); }
.res-bois     { background: rgba(139,90,43,0.12);  color: #b07840; border: 1px solid rgba(139,90,43,0.35); }
.res-pierre   { background: rgba(120,120,120,0.1); color: #999;    border: 1px solid rgba(120,120,120,0.25); }
.res-emeraude { background: rgba(80,200,120,0.08); color: #60d890; border: 1px solid rgba(80,200,120,0.25); }

.title-tag { font-family: 'Cinzel', serif; display: inline-block; padding: 3px 10px; font-size: 0.6rem; letter-spacing: 2px; text-transform: uppercase; border-radius: 1px; }
.title-emperor { background: rgba(200,148,42,0.12); color: var(--gold-light); border: 1px solid rgba(200,148,42,0.4); }
.title-lord    { background: rgba(180,180,255,0.08); color: #aaaaee; border: 1px solid rgba(180,180,255,0.25); }
.title-explorer{ background: rgba(100,200,255,0.08); color: #70c8ff; border: 1px solid rgba(100,200,255,0.25); }

.player-avatar { width: 28px; height: 28px; background: rgba(200,148,42,0.1); border: 1px solid var(--gold-dim); border-radius: 2px; display: inline-block; margin-right: 12px; vertical-align: middle; }

/* ══ FOOTER ══ */
#footer { background: #03060e; border-top: 1px solid var(--gold-dim); padding: 40px 48px 20px; font-family: 'Cinzel', serif; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; margin-bottom: 32px; }
.footer-left { display: flex; flex-direction: column; gap: 8px; }
.footer-logo { font-family: 'Cinzel Decorative', serif; font-size: 1.2rem; color: var(--gold-light); text-shadow: 0 0 20px rgba(200,148,42,0.4); }
.footer-tagline { font-size: 0.6rem; letter-spacing: 2px; color: var(--text-dim); font-style: italic; font-family: 'IM Fell English', serif; }
.footer-center { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.footer-link { font-size: 0.6rem; letter-spacing: 3px; text-transform: uppercase; color: var(--text-dim); text-decoration: none; transition: color 0.3s; }
.footer-link:hover { color: var(--gold-light); }
.footer-right { font-size: 0.6rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); }
.footer-right strong { color: var(--parchment); }
.footer-bottom { text-align: center; font-size: 0.55rem; letter-spacing: 2px; color: rgba(232,223,192,0.2); text-transform: uppercase; padding-top: 20px; border-top: 1px solid rgba(200,148,42,0.08); }

/* ══ ANIMATIONS ══ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 8px #4ade80; } 50% { opacity: 0.5; box-shadow: 0 0 3px #4ade80; } }

/* ══ PAGE FADE-IN ══ */
.page { animation: none; }
.page.fade-in { animation: pageFadeIn 0.4s ease forwards; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ══ SCROLL REVEAL ══ */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ══ PODIUM AVATAR + CROWN ══ */
.podium-avatar { display: flex; align-items: center; justify-content: center; font-family: 'Cinzel', serif; font-size: 1.6rem; font-weight: 700; color: var(--parchment); letter-spacing: 1px; }
.podium-avatar.rank-1 { font-size: 2rem; color: var(--gold-light); }
.podium-crown { font-size: 2rem; color: var(--gold-light); text-shadow: 0 0 20px rgba(200,148,42,0.8), 0 0 40px rgba(200,148,42,0.4); animation: crownFloat 2.5s ease-in-out infinite; margin-bottom: 6px; }
@keyframes crownFloat {
  0%, 100% { transform: translateY(0); text-shadow: 0 0 20px rgba(200,148,42,0.8), 0 0 40px rgba(200,148,42,0.4); }
  50%       { transform: translateY(-6px); text-shadow: 0 0 30px rgba(200,148,42,1), 0 0 60px rgba(200,148,42,0.6); }
}

/* ══ FLIP CARDS VOIES ══ */
.voie-wrapper { perspective: 1200px; cursor: pointer; height: 440px; }
.voie-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.voie-wrapper.flipped .voie-card-inner { transform: rotateY(180deg); }
.voie-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; padding: 36px 28px; box-sizing: border-box; overflow: hidden; border-width: 2px !important; }
.voie-back { transform: rotateY(180deg); background: rgba(200,148,42,0.06); align-items: flex-start; }
.voie-icon { font-size: 3.5rem; margin-bottom: 20px; }
.voie-sep { width: 40px; height: 1px; margin-bottom: 20px; flex-shrink: 0; }
.voie-titre { font-family: 'Cinzel', serif; font-size: 0.85rem; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; margin-bottom: 16px; text-align: center; }
.voie-desc { font-family: 'IM Fell English', serif; font-size: 1.1rem; line-height: 1.9; color: var(--parchment); opacity: 0.6; font-style: italic; text-align: center; flex: 1; }
.voie-badge { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 3px; text-transform: uppercase; border: 1px solid; padding: 10px 20px; margin-top: 24px; flex-shrink: 0; }
.voie-back-texte { font-family: 'IM Fell English', serif; font-size: 1.05rem; line-height: 1.75; color: #fff; margin-bottom: 14px; }
.voie-back-liste { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.voie-back-liste li { font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 2px; color: var(--gold); opacity: 0.85; }
.voie-hint { animation: hintPulse 2.5s ease-in-out infinite; }
@keyframes hintPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }
.voie-wrapper:hover:not(.flipped) .voie-card-inner { transform: translateY(-4px); }
.voie-wrapper:hover:not(.flipped) .voie-front { border-color: rgba(200,148,42,0.6) !important; box-shadow: 0 0 40px rgba(200,148,42,0.2), inset 0 0 30px rgba(200,148,42,0.04); }
.grid-has-flipped .voie-wrapper:not(.flipped) { opacity: 0.45; transition: opacity 0.4s ease; }
.grid-has-flipped .voie-wrapper.flipped { opacity: 1; }

/* ══ GRADES ══ */
.grade-card { transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease; }
.grade-card:hover { border-color: rgba(200,148,42,0.5) !important; box-shadow: 0 0 30px rgba(200,148,42,0.12); transform: translateY(-3px); }
.grade-card.active { border-color: var(--gold) !important; box-shadow: 0 0 40px rgba(200,148,42,0.2); }
.grades-progress { display: flex; align-items: center; justify-content: center; gap: 0; max-width: 900px; margin: 0 auto 48px; }
.grades-progress-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.grades-progress-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(200,148,42,0.3); border: 1px solid rgba(200,148,42,0.5); }
.grades-progress-dot.emperor { background: var(--gold); box-shadow: 0 0 10px rgba(200,148,42,0.6); }
.grades-progress-dot.active { background: var(--gold-light); box-shadow: 0 0 14px rgba(200,148,42,0.8); transform: scale(1.6); transition: all 0.3s ease; }
.grades-progress-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(200,148,42,0.3), rgba(200,148,42,0.5)); min-width: 60px; }
.grades-progress-label { font-family: 'Cinzel', serif; font-size: 0.55rem; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); opacity: 0.5; }

/* ══ BOUTON RETOUR EN HAUT ══ */
#back-to-top { position: fixed; bottom: 32px; right: 32px; width: 44px; height: 44px; background: rgba(200,148,42,0.15); border: 1px solid var(--gold-dim); color: var(--gold); font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease, background 0.2s ease; z-index: 999; }
#back-to-top.visible { opacity: 1; pointer-events: all; }
#back-to-top:hover { background: rgba(200,148,42,0.3); }
