:root {
  --primary: #e62429; /* Marvel Red / Metal Red */
  --primary-dark: #b91d21;
  --secondary: #1a1a1a;
  --bg-dark: #121212;
  --bg-card: #1e1e1e;
  --text-main: #ffffff;
  --text-dim: #b0b0b0;
  --success: #4caf50;
  --error: #f44336;
  --warning: #ff9800;
  --border-color: #333;
  --radius: 8px;
  --font-heading: 'Rajdhani', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --gold: #ffd700;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Espace pour le footer sticky (Pub uniquement maintenant) */
  padding-bottom: 120px; 
}

/* === LAYOUT & CONTAINER === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.hidden {
  display: none !important;
}

/* === HEADER === */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s;
}

.logo-container:hover {
  transform: scale(1.02);
}

.logo-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 5px rgba(230, 36, 41, 0.5));
}

h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Progress Badge */
.progress-badge {
  background: var(--bg-card);
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  width: 100px;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  width: 0%;
  transition: width 0.5s;
}

.next-unlock {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.control-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 15px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.control-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* === NAVIGATION TABS === */
.nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.nav-tab {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-tab:hover, .nav-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.vip-tab {
  background: linear-gradient(45deg, #2c2c2c, #4a4a4a);
  border-color: var(--gold);
  color: var(--gold);
}

.vip-tab:hover, .vip-tab.active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

/* === CONTENT SECTIONS === */
.section-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === QUIZ MODES GRID === */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mode-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 5px 15px rgba(230, 36, 41, 0.2);
}

.mode-card.locked {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.mode-card.locked:hover {
  transform: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.mode-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.mode-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0;
}

.mode-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex: 1;
}

.mode-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 10px;
}

.highscore {
  color: var(--gold);
}

/* === GAME INTERFACE === */
.game-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  position: relative;
}

.game-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-family: var(--font-heading);
}

.timer {
  color: var(--primary);
  font-weight: bold;
}

.score-display {
  color: var(--success);
}

.question-text {
  font-size: 1.5rem;
  text-align: center;
  margin: 30px 0;
  font-weight: 500;
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.answer {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-size: 1.1rem;
}

.answer:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--text-dim);
}

.answer.selected {
  background: var(--primary);
  border-color: var(--primary);
}

.answer.correct {
  background: var(--success);
  border-color: var(--success);
  animation: pulseSuccess 0.5s ease;
}

.answer.wrong {
  border-color: var(--error);
  background: rgba(244, 67, 54, 0.2);
  opacity: 0.7;
  animation: shakeError 0.4s ease;
}

@keyframes pulseSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 0 15px var(--success); }
  100% { transform: scale(1); }
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* === ANECDOTES === */
.anecdotes-list {
  display: grid;
  gap: 15px;
}

.anecdote-card {
  background: var(--bg-card);
  padding: 15px;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}

.anecdote-card.locked {
  filter: blur(4px);
  user-select: none;
  opacity: 0.5;
}

/* === FEEDBACK OVERLAY === */
.feedback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.feedback-content {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius);
  text-align: center;
  max-width: 500px;
  width: 90%;
  border: 1px solid var(--border-color);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.feedback-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.feedback-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 10px;
}

.feedback-text {
  color: var(--text-dim);
  margin-bottom: 30px;
}

.feedback-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-color);
  padding: 10px 25px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

/* === STATS & CHARTS === */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border-color);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--primary);
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-transform: uppercase;
}

/* === VIP STYLES === */
.vip-badge {
  background: var(--gold);
  color: black;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  vertical-align: middle;
  margin-left: 5px;
}

.vip-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  background: #1a1a1a;
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 30px;
  z-index: 2000;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.2);
}

.vip-header {
  text-align: center;
  margin-bottom: 30px;
}

.vip-header h2 {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 2rem;
}

.vip-features {
  display: grid;
  gap: 15px;
  margin-bottom: 30px;
}

.vip-feature {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 8px;
}

.vip-feature i {
  color: var(--gold);
  font-size: 1.5rem;
  width: 30px;
  text-align: center;
}

.vip-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.plan-card {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #333;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-card:hover {
  border-color: var(--gold);
  background: #2a2a2a;
}

.plan-price {
  font-size: 1.5rem;
  color: var(--text-main);
  margin: 10px 0;
  font-weight: bold;
}

.plan-period {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  .logo-icon { width: 35px; height: 35px; }
  .nav-tab { padding: 8px 12px; font-size: 0.8rem; }
  .container { padding: 10px; }
  
  /* OPTIMISATIONS MOBILE (FROM MOBILE.CSS) */
  .game-container {
    width: 95%;
    padding: 10px;
    margin: 10px auto;
  }

  .mode-grid {
    grid-template-columns: 1fr; /* Une seule colonne */
  }

  .mode-card {
    padding: 12px;
  }

  /* Boutons de réponse plus gros (Touch Friendly) */
  .answers-grid {
    grid-template-columns: 1fr; /* Une seule colonne */
    gap: 10px;
  }

  .answer {
    padding: 15px;
    font-size: 1rem;
    min-height: 60px; /* Zone de clic confortable */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Panneau de contrôle (Suivant / Valider) fixé en bas si besoin */
  .controls-area {
    position: sticky;
    bottom: 0;
    background: #000;
    padding: 10px;
    z-index: 100;
    border-top: 1px solid #333;
  }

  /* Navigation Tabs (Icônes seules ou texte réduit) */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    justify-content: flex-start;
  }
  
  .nav-tab {
    padding: 8px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
  }
  
  /* Authentification */
  .auth-forms-container {
    width: 100%;
  }
  
  .auth-input {
    width: 100%;
  }
}

/* Petits écrans (iPhone SE, etc.) */
@media (max-width: 380px) {
  header h1 { font-size: 1.5rem; }
  .mode-title { font-size: 1rem; }
  .answer { font-size: 0.9rem; }
}

/* === PARTENAIRE / SPONSOR (Bannière Sticky) === */
.sponsor-sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: #111;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 2px solid var(--primary); /* Bordure rouge pour visibilité */
  box-shadow: 0 -5px 20px rgba(0,0,0,0.8);
}

.sponsor-sticky-footer.hidden {
  display: none !important;
}

.sponsor-placeholder {
  width: 728px;
  max-width: 95%;
  height: 80px;
  background: repeating-linear-gradient(
    45deg,
    #1a1a1a,
    #1a1a1a 10px,
    #222 10px,
    #222 20px
  );
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  border: 1px dashed #555;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Ajustement du container principal pour ne pas être caché par la pub */
body.has-sponsor {
  padding-bottom: 100px;
}

/* === INTERSTITIEL (Overlay) === */
.sponsor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 10000; /* Au-dessus de tout */
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

.sponsor-content {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  padding: 20px;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
  animation: popIn 0.3s ease;
}

.sponsor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #333;
  padding-bottom: 15px;
}

.close-ad-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.close-ad-btn:not(:disabled):hover {
  background: var(--primary);
}

.close-ad-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ad-placeholder-large {
  background: #222;
  height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #555;
  border: 2px dashed #333;
  gap: 10px;
}

/* === SPOTIFY PLAYER (TOP) === */
.spotify-player-wrapper {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9000;
  background: rgba(18, 18, 18, 0.95); /* Dark bg with slight transparency */
  border-bottom: 1px solid #333;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.spotify-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  gap: 15px;
}

.spotify-toggle, .spotify-settings {
  background: transparent;
  border: 1px solid #444;
  color: #fff;
  padding: 5px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.spotify-toggle:hover, .spotify-settings:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.spotify-frame {
  padding: 10px;
  border-top: 1px solid #333;
  animation: slideDown 0.3s ease;
}

.spotify-frame.hidden {
  display: none;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}