/* ── POLICES ── */
@font-face {
  font-family: 'NeueEinstellung';
  src: url('../assets/fonts/NeueEinstellung-Thin.woff2') format('woff2'),
       url('../assets/fonts/NeueEinstellung-Thin.woff') format('woff'),
       url('../assets/fonts/NeueEinstellung-Thin.otf') format('opentype'),
       url('../assets/fonts/NeueEinstellung-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NeueEinstellung';
  src: url('../assets/fonts/NeueEinstellung-Light.woff2') format('woff2'),
       url('../assets/fonts/NeueEinstellung-Light.woff') format('woff'),
       url('../assets/fonts/NeueEinstellung-Light.otf') format('opentype'),
       url('../assets/fonts/NeueEinstellung-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NeueEinstellung';
  src: url('../assets/fonts/NeueEinstellung-Regular.woff2') format('woff2'),
       url('../assets/fonts/NeueEinstellung-Regular.woff') format('woff'),
       url('../assets/fonts/NeueEinstellung-Regular.otf') format('opentype'),
       url('../assets/fonts/NeueEinstellung-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NeueEinstellung';
  src: url('../assets/fonts/NeueEinstellung-Medium.woff2') format('woff2'),
       url('../assets/fonts/NeueEinstellung-Medium.woff') format('woff'),
       url('../assets/fonts/NeueEinstellung-Medium.otf') format('opentype'),
       url('../assets/fonts/NeueEinstellung-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NeueEinstellung';
  src: url('../assets/fonts/NeueEinstellung-SemiBold.woff2') format('woff2'),
       url('../assets/fonts/NeueEinstellung-SemiBold.woff') format('woff'),
       url('../assets/fonts/NeueEinstellung-SemiBold.otf') format('opentype'),
       url('../assets/fonts/NeueEinstellung-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NeueEinstellung';
  src: url('../assets/fonts/NeueEinstellung-Bold.woff2') format('woff2'),
       url('../assets/fonts/NeueEinstellung-Bold.woff') format('woff'),
       url('../assets/fonts/NeueEinstellung-Bold.otf') format('opentype'),
       url('../assets/fonts/NeueEinstellung-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── VARIABLES & BASE ── */
:root {
  --cream: #FFF8EE;
  --green-dark: #2B6B30;
  --green-mid: #3E9145;
  --green-light: #6DC071;
  --coral: #E8634A;
  --dark: #1C1C1C;
  --beige: #F2E8D5;
  --french-blue: #0055A4;
  --french-red: #EF4135;

  --font-sans: 'NeueEinstellung', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  background: var(--cream);
  color: var(--dark);
  overflow-x: hidden;
}

/* ── NAVBAR ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 48px;
  background: rgba(255, 248, 238, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--beige);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dark);
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 50px;
  transition: all 0.25s;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--green-dark);
  color: #fff;
}

.nav-logo img {
  height: 60px;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: multiply;
}

@media (max-width: 640px) {
  #navbar {
    padding: 10px 16px;
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 11px;
    letter-spacing: 1px;
  }

  .nav-logo img {
    height: 44px;
  }
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 48px 60px;
}

.eyebrow {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  color: var(--green-dark);
  letter-spacing: 3px;
  margin-bottom: 24px;
  opacity: 0.7;
}

.hero-title {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: clamp(60px, 10vw, 110px);
  line-height: 1;
  color: var(--dark);
}

.hero-title span {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--green-dark);
  font-size: clamp(70px, 11vw, 120px);
  display: block;
}

.hero-sub {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 18px;
  color: #666;
  max-width: 640px;
  margin: 24px 0 12px;
}

.hero-note {
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  color: #999;
  max-width: 560px;
  margin: 0 0 36px;
}

.btn-primary {
  background: var(--green-dark);
  color: #fff;
  border: none;
  padding: 16px 36px;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(43, 107, 48, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(43, 107, 48, 0.4);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── PRE-GAME OVERLAYS ── */
#pregame-name,
#pregame-avatar,
#leaderboard,
#historique {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(28, 28, 28, 0.96);
  align-items: center;
  justify-content: center;
}

#pregame-name.visible,
#pregame-avatar.visible,
#leaderboard.visible,
#historique.visible {
  display: flex;
}

.pregame-box {
  background: var(--cream);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 460px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.pregame-step {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  color: var(--green-mid);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.pregame-box h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 36px;
  color: var(--dark);
  margin-bottom: 8px;
}

.pregame-sub {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 14px;
  color: #888;
  margin-bottom: 28px;
}

/* Input Instagram */
.input-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid var(--green-mid);
  border-radius: 50px;
  padding: 12px 20px;
  margin-bottom: 20px;
  background: #fff;
  gap: 8px;
}

.input-at {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 20px;
  color: var(--green-dark);
}

#instagram-input {
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  color: var(--dark);
  width: 100%;
  background: transparent;
}

/* Grille avatars */
.avatar-grid {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 28px;
}

.avatar-card {
  cursor: pointer;
  padding: 16px 12px;
  border-radius: 16px;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: var(--beige);
  flex: 1;
}

.avatar-card:hover {
  border-color: var(--green-mid);
  transform: translateY(-4px);
}

.avatar-card.selected {
  border-color: var(--green-dark);
  background: #e8f5e9;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(43,107,48,0.2);
}

.avatar-card p {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.avatar-card .avatar-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 11px;
  color: #888;
  margin-top: 6px;
  text-transform: none;
  letter-spacing: normal;
}

.avatar-card img {
  width: 70px;
  height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  transition: transform 0.2s;
}

.avatar-card:hover img,
.avatar-card.selected img {
  transform: scale(1.08);
}

/* ── CLASSEMENT ── */
.leaderboard-box {
  background: var(--cream);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 460px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  text-align: left;
}

.leaderboard-status {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  color: #888;
  padding: 24px 0;
  text-align: center;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: minmax(28px, auto) 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: var(--beige);
  border-radius: 12px;
  padding: 10px 14px;
}

.leaderboard-rank {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--green-dark);
}

.leaderboard-pseudo {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-cocktail {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 12px;
  color: #888;
}

.leaderboard-score {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--coral);
}

/* ── GAME OVERLAY ── */
#game-section {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(28, 28, 28, 0.96);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#game-section.visible {
  display: flex;
}

.game-header {
  text-align: center;
  margin-bottom: 12px;
}

#game-title {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: 22px;
  color: var(--green-light);
  margin-bottom: 6px;
}

.game-score {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  color: #F5A28C;
}

#gameCanvas {
  border: 3px solid var(--green-mid);
  border-radius: 12px;
  background: #0a1a0d;
  box-shadow: 0 0 40px rgba(77, 193, 85, 0.25);
  max-width: 100%;
  transition: border-color 0.4s, box-shadow 0.4s;
  touch-action: none;
}

#gameCanvas.theme-ginger {
  border-color: #C98A3D;
  box-shadow: 0 0 40px rgba(201, 138, 61, 0.35);
}

#gameCanvas.theme-pamplemousse {
  border-color: #E8638F;
  box-shadow: 0 0 40px rgba(232, 99, 143, 0.35);
}

#gameCanvas.theme-tonic {
  border-color: #D4C84A;
  box-shadow: 0 0 40px rgba(212, 200, 74, 0.35);
}

.game-controls {
  margin-top: 10px;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 300;
}

#close-game {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 28px;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
}

#close-game:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* ── FOOTER ── */
footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.5);
  padding: 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}

.footer-flag {
  display: flex;
  gap: 6px;
  align-items: center;
}

.flag-blue  { width: 18px; height: 6px; background: var(--french-blue); border-radius: 2px; }
.flag-white { width: 18px; height: 6px; background: #fff; border-radius: 2px; }
.flag-red   { width: 18px; height: 6px; background: var(--french-red); border-radius: 2px; }