/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Almendra', serif;
  background-color: #3e2f23;
  color: #f5e6b3;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* MODE CLAIR */
body.light-mode {
  background-color: #f5e6d3;
  color: #3e2f23;
}

body.light-mode .menu-toggle,
body.light-mode .theme-toggle {
  background: rgba(245, 230, 211, 0.9);
  color: #3e2f23;
  border-color: #3e2f23;
}

body.light-mode .menu-toggle:hover,
body.light-mode .theme-toggle:hover {
  background: #3e2f23;
  color: #f5e6d3;
}

body.light-mode .side-menu {
  background: rgba(255, 255, 255, 0.98);
  border-right-color: #3e2f23;
}

body.light-mode .menu-links a,
body.light-mode .close-menu {
  color: #3e2f23;
}

body.light-mode h2 {
  background: rgba(245, 230, 211, 0.8);
  color: #3e2f23;
}

body.light-mode .carte-back {
  background: linear-gradient(135deg, #f5e6d3 0%, #e8d5b8 100%);
}

body.light-mode .carte-back h3,
body.light-mode .carte-back p {
  color: #3e2f23;
}

body.light-mode #searchInput {
  background: rgba(62, 47, 35, 0.1);
  border-color: #3e2f23;
  color: #3e2f23;
}

body.light-mode .suggestions {
  background: rgba(255, 255, 255, 0.95);
}

/* ============================================
   MENU LATÉRAL
   ============================================ */
.menu-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: rgba(62, 47, 35, 0.9);
  color: #f5e6b3;
  border: 2px solid #f5e6b3;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 1.5em;
  cursor: pointer;
  transition: all 0.3s;
}

.menu-toggle:hover {
  background: #f5e6b3;
  color: #3e2f23;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: rgba(62, 47, 35, 0.9);
  color: #f5e6b3;
  border: 2px solid #f5e6b3;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5em;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: #f5e6b3;
  color: #3e2f23;
  transform: rotate(180deg);
}

.side-menu {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background: rgba(31, 23, 16, 0.98);
  padding: 20px;
  z-index: 1001;
  transition: left 0.4s ease;
  overflow-y: auto;
  border-right: 3px solid #f5e6b3;
}

.side-menu.open {
  left: 0;
}

.close-menu {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: #f5e6b3;
  font-size: 2em;
  cursor: pointer;
  transition: transform 0.3s;
}

.close-menu:hover {
  transform: rotate(90deg);
}

.menu-links {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.menu-links a {
  color: #f5e6b3;
  text-decoration: none;
  font-size: 1.2em;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.3s;
}

.menu-links a:hover {
  background: rgba(245, 230, 179, 0.2);
}

.search-container {
  margin-top: 30px;
}

#searchInput {
  width: 100%;
  padding: 10px;
  background: rgba(245, 230, 179, 0.1);
  border: 1px solid #f5e6b3;
  border-radius: 6px;
  color: #f5e6b3;
  font-family: 'Almendra', serif;
}

.suggestions {
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
}

.suggestions div {
  padding: 8px;
  cursor: pointer;
  border-bottom: 1px solid rgba(245, 230, 179, 0.2);
}

.suggestions div:hover {
  background: rgba(245, 230, 179, 0.2);
}

.menu-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.9em;
  opacity: 0.8;
}

/* ============================================
   SECTIONS - GRILLE 2 COLONNES PAR DÉFAUT
   ============================================ */
section:not(#event-cards) {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 15px;
  padding: 15px;
  margin: 60px auto;
  max-width: 1400px;
}

h2 {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1.5em;
  font-family: 'Pirata One', serif;
  background: rgba(62, 47, 35, 0.8);
  color: #f5e6b3;
  padding: 12px 24px;
  border-radius: 32px;
  box-shadow: inset 0 0 8px #f5e6b3;
  margin: 0 auto 20px auto;
  max-width: fit-content;
}

/* ============================================
   CARTES - ANIMATIONS & EFFETS
   ============================================ */
.carte-jeu {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  perspective: 1000px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carte-jeu.visible {
  opacity: 1;
  transform: translateY(0);
}

.carte-jeu:hover {
  transform: translateY(-8px) scale(1.03);
  filter: drop-shadow(0 12px 24px rgba(212, 175, 55, 0.4));
}

.carte-jeu:hover .carte-front {
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
}

.carte-jeu:hover .carte-front img {
  filter: brightness(1.1);
}

.carte-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.carte-jeu.flipped .carte-inner {
  transform: rotateY(180deg);
}

.carte-front,
.carte-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: all 0.3s ease;
}

.carte-front {
  background: #241c14;
  border: 2px solid rgba(212, 175, 55, 0.3);
}

.carte-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.3s ease;
}

.carte-back {
  background: linear-gradient(135deg, #2a1f15 0%, #1a130d 100%);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 12px;
  border: 3px solid rgba(212, 175, 55, 0.5);
  box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.2);
  overflow-y: auto;
}

.carte-back h3 {
  font-size: 0.95em;
  color: #f5e6b3;
  margin-bottom: 8px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-family: 'Pirata One', serif;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.carte-back p {
  white-space: pre-line;
  text-align: left;
  line-height: 1.5;
  font-size: 0.8em;
  color: #dbc86e; /* ou la couleur de ton choix */
  flex: 1;
}

.carte-back p::-webkit-scrollbar {
  width: 3px;
}

.carte-back p::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 2px;
}

/* ============================================
   CARTES VM
   ============================================ */
#event-cards {
  display: block;
  margin: 60px auto;
  max-width: 1400px;
  padding: 15px;
}

#event-cards h2 {
  text-align: center;
  margin-bottom: 30px;
}

.event-subtitle {
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Pirata One', serif;
  font-size: 1.4em;
  margin: 25px auto 15px auto;
}

.gold-title {
  color: gold;
  text-shadow: 0 0 10px gold;
}

.silver-title {
  color: silver;
  text-shadow: 0 0 10px silver;
}

.bronze-title {
  color: #cd7f32;
  text-shadow: 0 0 10px #cd7f32;
}

.category {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 15px 0 30px 0;
}

.carte-vm {
  width: 100%;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
}

.carte-vm.visible {
  opacity: 1;
  transform: translateY(0);
}

.carte-vm:hover {
  transform: scale(1.08);
}

.carte-vm.gold {
  border: 3px solid gold;
  box-shadow: 0 0 15px gold;
}

.carte-vm.silver {
  border: 3px solid silver;
  box-shadow: 0 0 15px silver;
}

.carte-vm.bronze {
  border: 3px solid #cd7f32;
  box-shadow: 0 0 15px #cd7f32;
}

.carte-vm img {
  width: 100%;
  height: auto;
  display: block;
}

.carte-vm.zoomed {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  width: 85vw;
  max-width: 400px;
  height: auto;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

#vm-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1999;
}

#vm-overlay.active {
  display: block;
}

body.no-scroll {
  overflow: hidden;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 481px) {
  section:not(#event-cards) {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 18px;
  }

  .category {
    grid-template-columns: repeat(3, 1fr);
  }

  h2 {
    font-size: 1.7em;
  }
}

@media (min-width: 769px) {
  section:not(#event-cards) {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
  }

  .category {
    grid-template-columns: repeat(4, 1fr);
  }

  h2 {
    font-size: 2em;
  }
}

@media (min-width: 1201px) {
  section:not(#event-cards) {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 22px;
  }

  .category {
    grid-template-columns: repeat(5, 1fr);
  }
}

.menu-toggle {
  top: 10px;
  left: 10px;
}

/* ============================================
   ANIMATION TEXTE PROGRESSIF AU FLIP
   ============================================ */
.carte-back h3 {
  animation: fadeInText 0.4s ease 0.3s both;
}

.carte-back p {
  animation: fadeInText 0.6s ease 0.4s both;
}

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

/* ============================================
   TEXTE PLUS GRAND SUR DESKTOP
   ============================================ */
@media (min-width: 769px) {
  .carte-back h3 {
    font-size: 1.3em !important;
  }

  .carte-back p {
    font-size: 0.85em !important;
    line-height: 1.5 !important;
  }
}

@media (min-width: 1201px) {
  .carte-back h3 {
    font-size: 1.4em !important;
  }

  .carte-back p {
    font-size: 0.95em !important;
    line-height: 1.6 !important;
  }
}

/* ============================================
   BOUTON DÉTAILS
   ============================================ */
.btn-details {
  display: block;
  width: calc(100% - 20px);
  margin: 10px auto 0;
  padding: 8px 16px;
  background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
  color: #1a130d;
  border: none;
  border-radius: 6px;
  font-family: 'Pirata One', serif;
  font-size: 0.9em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
  animation: fadeInText 0.6s ease 0.6s both;
}

.btn-details:hover {
  background: linear-gradient(135deg, #f5d061 0%, #d4af37 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
}

.btn-details:active {
  transform: translateY(0);
}

/* ============================================
   PANNEAU LATÉRAL STYLE PANINI
   ============================================ */
.details-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 500px;
  height: 100vh;
  background: linear-gradient(135deg, #2a1f15 0%, #1a130d 100%);
  border-left: 3px solid rgba(212, 175, 55, 0.5);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.8);
  z-index: 4000;
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.details-panel.active {
  right: 0;
}

.details-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 3999;
  transition: opacity 0.3s ease;
}

.details-overlay.active {
  display: block;
}

.details-content {
  padding: 30px;
  color: #f5e6b3;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.details-title {
  font-family: 'Pirata One', serif;
  font-size: 2em;
  color: #d4af37;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.close-details {
  background: rgba(212, 175, 55, 0.2);
  border: 2px solid rgba(212, 175, 55, 0.4);
  color: #f5e6b3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-details:hover {
  background: rgba(212, 175, 55, 0.4);
  transform: rotate(90deg);
}

.details-image {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  object-fit: cover;
}

.details-section {
  margin-bottom: 25px;
}

.details-section h3 {
  font-family: 'Pirata One', serif;
  font-size: 1.5em;
  color: #d4af37;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.details-section h3::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, #d4af37 0%, transparent 100%);
  border-radius: 2px;
}

.details-section p {
  font-size: 1.05em;
  line-height: 1.8;
  color: #dbc86e;
  margin-bottom: 15px;
}

.details-section ul {
  list-style: none;
  padding: 0;
}

.details-section li {
  padding: 8px 0 8px 20px;
  position: relative;
  color: #dbc86e;
  line-height: 1.6;
}

.details-section li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #d4af37;
  font-weight: bold;
}

/* Mode clair */
body.light-mode .details-panel {
  background: linear-gradient(135deg, #f5e6d3 0%, #e8d5b8 100%);
  border-left-color: rgba(62, 47, 35, 0.3);
}

body.light-mode .details-title {
  color: #3e2f23;
}

body.light-mode .details-section h3 {
  color: #3e2f23;
}

body.light-mode .details-section p,
body.light-mode .details-section li {
  color: #3e2f23;
}

body.light-mode .close-details {
  background: rgba(62, 47, 35, 0.1);
  border-color: rgba(62, 47, 35, 0.3);
  color: #3e2f23;
}

/* Mobile */
@media (max-width: 768px) {
  .details-panel {
    width: 100%;
    max-width: none;
  }

  .details-content {
    padding: 20px;
  }

  .details-title {
    font-size: 1.6em;
  }
}
body.light-mode .details-panel,
body.light-mode .details-section p,
body.light-mode .details-section li {
  color: #1a130d; /* ou #000 pour noir */
}
body.light-mode .details-panel,
body.light-mode .details-section p,
body.light-mode .details-section li {
  color: #1a130d;
}
body.light-mode .details-panel,
body.light-mode .details-panel *,
body.light-mode .details-content,
body.light-mode .details-content *,
body.light-mode .details-title,
body.light-mode .details-section,
body.light-mode .details-section *,
body.light-mode .details-section h3,
body.light-mode .details-section p,
body.light-mode .details-section li,
body.light-mode .details-section ul {
  color: #1a130d !important;
}


