/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: none;
    overflow-x: hidden;
}

/* Curseur personnalisé */
.custom-cursor {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.4) 0%, transparent 70%);
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
}

/* Barre de progression */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1001; /* Pour être au-dessus de la nav */
    background: rgba(255, 255, 255, 0.1);
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #facc15);
    width: 0%;
    transition: width 0.2s ease-out;
}

/* Hero section */
.hero {
    height: 100vh;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    width: 100%;
    overflow: hidden;
    z-index: 1001; /* Pour être au-dessus de la nav */
    top: 0;
    left: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}

.hero-content {
    text-align: center;
    z-index: 2;
    padding: 2rem;
    max-width: 90%;
}

.title {
    font-size: 8rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    background: linear-gradient(to right, #f97316, #facc15, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 3rem;
    color: #fdba74;
    letter-spacing: 0.5em;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.description {
    max-width: 600px;
    margin: 0 auto;
    color: #cbd5e1;
    line-height: 1.6;
    font-size: 1.2rem;
}

/* Grille des factions */
.factions-grid {
    max-width: 90%; /* Réduit la largeur maximale */
    margin: 100vh auto 4rem auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.7);
}

/* Section header */
.section-header {
    margin-top: 8rem; /* Espace avant chaque section */
    margin-bottom: 4rem;
    padding: 2rem;
    text-align: center;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background: radial-gradient(circle at center, 
        var(--section-color, rgba(249, 115, 22, 0.1)) 0%,
        transparent 70%);
    z-index: -1;
}

.section-header h2 {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-shadow: 0 0 20px var(--section-color, rgba(249, 115, 22, 0.5));
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    padding: 0 2rem;
}

.section-divider {
    width: 200px;
    height: 4px;
    margin: 2rem auto;
    background: linear-gradient(90deg,
        transparent,
        var(--section-color, rgba(249, 115, 22, 1)),
        transparent
    );
    border-radius: 2px;
}

/* Grid pour les cartes de chaque section */
.section-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5rem;
    margin-bottom: 8rem; /* Espace vertical entre les sections */
}

/* Barème de violence */
.violence-meter {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.violence-label {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.violence-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 0.5rem;
    height: 8px;
}

.violence-segment {
    flex: 1;
    height: 100%;
    background-color: var(--segment-color, rgba(255, 255, 255, 0.1));
    border-radius: 2px;
    transition: all 0.3s ease;
}

.violence-value {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: right;
}

/* Ajustement du modal pour inclure le barème */
.modal-info .violence-meter {
    margin-top: 2rem;
}

.modal-info .violence-bar {
    height: 12px;
}

.modal-info .violence-label {
    font-size: 1rem;
}

.modal-info .violence-value {
    font-size: 0.9rem;
}

/* Animation au hover */
.faction-card:hover .violence-segment {
    transform: scaleY(1.2);
}

/* Cartes des factions */
.faction-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: linear-gradient(to bottom right, #1f2937, #111827);
    transform: perspective(1000px) rotateY(0deg) translateY(0);
    transition: all 0.6s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100%; /* S'assure que la carte ne dépasse pas sa colonne */
    margin-bottom: 1rem; /* Espace entre les cartes */
    min-height: 500px; /* Hauteur minimale pour uniformité */

}

.faction-card:hover {
    transform: perspective(1000px) rotateY(5deg) translateZ(20px) translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.faction-image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
}

.faction-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.faction-card:hover .faction-image {
    transform: scale(1.1);
}

.faction-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
}

.faction-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to bottom, 
        rgba(31, 41, 55, 0.95),
        rgba(17, 24, 39, 0.95)
    );
}

.faction-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #f97316, #facc15);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.faction-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #d1d5db;
    margin-top: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 1000px;
    width: 100%;
    background: linear-gradient(to bottom, #1f2937, #111827);
    border-radius: 1rem;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(249, 115, 22, 0.3);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: none;
    z-index: 10;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(249, 115, 22, 0.5);
    transform: scale(1.1);
}

.modal-image-container {
    position: relative;
    aspect-ratio: 16/9;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 2rem;
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #f97316, #facc15);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-description {
    color: #e2e8f0;
    line-height: 1.6;
    font-size: 1.1rem;
}

/* Navigation du modal */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(249, 115, 22, 0.3);
    color: white;
    padding: 2rem;
    border: none;
    cursor: none;
    font-size: 2.5rem;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    border-radius: 0.5rem;
}

.modal-nav:hover {
    background: rgba(249, 115, 22, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 2rem;
}

.modal-next {
    right: 2rem;
}

/* Effet de sable */
.sand-effect {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 128px;
    pointer-events: none;
    overflow: hidden;
    z-index: 999;
}

.sand-waves {
    position: relative;
    height: 100%;
}

.sand-wave {
    position: absolute;
    width: 100%;
    opacity: 0.3;
    background: linear-gradient(90deg, 
        var(--section-color, rgba(249, 115, 22, 0.4)) 0%,
        transparent 50%,
        var(--section-color, rgba(249, 115, 22, 0.4)) 100%);
    filter: blur(1px);
}

/* Animations */
@keyframes wave {
    0%, 100% { 
        transform: translateX(0) translateY(0) scale(1);
    }
    50% { 
        transform: translateX(-30px) translateY(-2px) scale(1.02);
    }
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Particules de poussière */
.dust-particle {
    position: absolute;
    background: rgba(249, 115, 22, 0.2);
    border-radius: 50%;
    pointer-events: none;
}

/* Media Queries */
@media (max-width: 90%) {
    .section-grid {
        gap: 3rem;
    }
    
    .title {
        font-size: 6rem;
    }
}

@media (max-width: 900px) {
    .section-grid {
        grid-template-columns: 1fr; /* Une seule colonne pour les écrans plus petits */
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 4rem;
    }
    
    .subtitle {
        font-size: 2rem;
    }
    
    .section-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .modal-nav {
        padding: 1rem;
    }
    
    .modal-prev {
        left: 1rem;
    }
    
    .modal-next {
        right: 1rem;
    }
}

/* Classe utilitaire */
.hidden {
    display: none !important;
}

.faction-image-container.reserved {
    position: relative;
}

.faction-image-container.reserved::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2;
}

.reserved-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    background: rgba(235, 126, 3, 0.9);
    color: #000;
    padding: 0.5rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 3;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.faction-card:hover .faction-image-container.reserved .faction-image {
    transform: scale(1); /* Désactive l'effet de zoom sur les images réservées */
}

.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(249, 115, 22, 0.2);
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.nav-logo .nav-link {
  background: linear-gradient(to right, #f97316, #facc15);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: all 0.3s ease;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #f97316, #facc15);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: #f97316;
}

.nav-link:hover::after {
  width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-link {
    width: 100%;
    text-align: center;
  }
}