/* POLICES GLOBALES */
body { font-family: var(--font); }
h1, h2, h3, .btn-primary { font-family: 'Boogaloo', cursive; letter-spacing: 1px; }

/* GESTION DES ÉCRANS */
.screen {
  display: none; 
  width: 100vw; height: 100vh; 
  position: absolute; top: 0; left: 0;
  overflow: hidden; 
  background: transparent; 
  z-index: 1; 
}
.screen.active { display: flex; flex-direction: column; }

/* ========================================== */
/* 1. ÉCRAN DE CONNEXION                      */
/* ========================================== */
#screen-login { align-items: center; justify-content: center; }
.login-box {
  background: rgba(230, 215, 180, 0.95); backdrop-filter: blur(10px);
  padding: 40px; border-radius: var(--radius); border: 2px solid var(--panel-border);
  width: min(400px, 90vw); text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.login-box h1 { color: var(--accent-dark); font-size: 45px; margin-bottom: 10px; }
.login-box p { color: var(--text); margin-bottom: 30px; font-size: 16px; }
.form-group { text-align: left; margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; color: var(--text); margin-bottom: 5px; }
.form-group input {
  width: 100%; padding: 12px; border-radius: 8px; border: 2px solid var(--panel-border);
  background: white; color: var(--text); font-family: var(--font); font-size: 14px;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.button-group { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.btn-primary {
  background: var(--accent); color: white; padding: 14px; border-radius: 8px;
  font-weight: bold; font-size: 22px; transition: 0.2s; border: none; cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: transparent; color: var(--text); padding: 14px; border-radius: 8px;
  font-weight: bold; font-size: 22px; border: 2px solid var(--panel-border); transition: 0.2s; cursor: pointer;
}
.btn-secondary:hover { background: rgba(0,0,0,0.05); }

.btn-cancel {
  background: #6d482b; color: white; padding: 10px 15px; border-radius: 8px;
  font-size: 14px; border: none; transition: 0.2s; cursor: pointer; font-family: var(--font);
}
.btn-cancel:hover { background: #4e342e; }

/* ========================================== */
/* 2. CARROUSEL DES PERSONNAGES               */
/* ========================================== */
#screen-carousel { align-items: center; justify-content: center; }
.carousel-header { text-align: center; margin-bottom: 40px; }
.carousel-header h2 { color: white; font-size: 40px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.carousel-header p { font-size: 18px; color: #eee; font-weight: bold; text-shadow: 0 1px 3px rgba(0,0,0,0.8);}

.carousel-container { display: flex; align-items: center; gap: 30px; }
.nav-btn {
  background: var(--panel-bg); border: 2px solid var(--panel-border);
  color: var(--text); font-size: 30px; width: 60px; height: 60px; border-radius: 50%;
  cursor: pointer; transition: 0.2s; flex-shrink: 0;
}
.nav-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.character-card {
  width: 300px; height: 450px;
  border-radius: 15px; border: 4px solid var(--panel-border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  cursor: pointer; position: relative;
  overflow: hidden;
  background: #1e2c35;
}

.character-card img { width: 100%; height: 100%; object-fit: contain; }
.character-card:hover { transform: scale(1.03); border-color: var(--accent); transition: 0.3s; }

/* ========================================== */
/* 3. FICHE DÉTAILLÉE (STATS)                 */
/* ========================================== */
#screen-sheet { flex-direction: row; padding: 40px; align-items: center; justify-content: center; }
.sheet-container {
  display: flex; background: var(--panel-bg); border-radius: var(--radius);
  border: 2px solid var(--panel-border); width: min(1000px, 95vw); height: 85vh; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.sheet-image-box { flex: 1; background: #1e2c35; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sheet-image-box img { width: 100%; height: 100%; object-fit: contain; }

.sheet-info-box { flex: 1.5; padding: 30px; display: flex; flex-direction: column; }
.sheet-header-info h2 { font-size: 45px; color: var(--accent-dark); }
.bio-info { display: flex; gap: 15px; margin-top: 5px; font-size: 14px; color: var(--text); }
.bio-info b { color: var(--accent); }

.sheet-stats { flex: 1; margin-top: 20px; overflow-y: auto; padding-right: 10px; }
.slider-row { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.slider-row img { width: 40px; height: 40px; object-fit: contain; }
.slider-row label { width: 120px; font-size: 14px; font-weight: bold; color: var(--text); }
.stat-val { width: 40px; text-align: right; color: var(--accent-dark); font-weight: bold; font-size: 18px; }

input[type=range] { flex: 1; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track {
  width: 100%; height: 12px; background: #3a2817; border-radius: 6px; border: 1px solid #1a110a; box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; height: 26px; width: 26px; border-radius: 50%;
  background: linear-gradient(to bottom, #e0cda8, #BDAA6A); border: 2px solid #6d482b;
  box-shadow: 0 4px 6px rgba(0,0,0,0.6), inset 0 1px 2px rgba(255,255,255,0.6); margin-top: -8px; transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }

.sheet-footer { margin-top: 20px; border-top: 2px solid var(--panel-border); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.points-pool { font-size: 18px; font-weight: bold; color: var(--text); }
.points-pool span { color: var(--accent-dark); font-size: 28px; }

.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sheet-actions button { padding: 10px 15px; font-size: 16px; border-radius: 8px; }

.btn-back {
  position: absolute; top: 20px; left: 20px; background: var(--panel-bg);
  color: var(--text); border: 2px solid var(--panel-border); padding: 10px 20px; border-radius: 8px;
  font-family: 'Boogaloo'; font-size: 18px; cursor: pointer; z-index: 10;
}
.btn-back:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* ========================================== */
/* 4. MODAL DE COMPARAISON                    */
/* ========================================== */
#screen-compare { 
  align-items: center; 
  justify-content: center; 
  background: rgba(0,0,0,0.9); 
}
.compare-container {
  background: var(--panel-bg); padding: 30px; border-radius: var(--radius);
  border: 2px solid var(--panel-border); width: min(900px, 95vw); text-align: center;
  margin: auto; /* Ajouté pour que ça centre bien */
}
.compare-container h2 { color: var(--accent-dark); margin-bottom: 20px; font-size: 36px; }
.compare-grid { display: flex; justify-content: space-around; align-items: center; gap: 20px; }
.compare-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.compare-col img { width: 150px; height: 225px; object-fit: contain; background: #1e2c35; border-radius: 10px; margin-bottom: 10px; border: 2px solid var(--panel-border); }
.compare-col h3 { color: var(--accent-dark); font-size: 28px; }
.compare-col p { font-size: 14px; color: var(--text); margin-bottom: 15px; }
.compare-stats { text-align: left; width: 100%; font-family: var(--font); font-size: 14px; background: #4e342e; color: #fff; padding: 10px; border-radius: 8px; }
.compare-stats div { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 4px 0; }
.compare-stats div:last-child { border-bottom: none; }
.compare-vs { font-family: 'Boogaloo'; font-size: 45px; color: #e53935; text-shadow: 0 0 5px rgba(0,0,0,0.5); }

/* ========================================== */
/* RESPONSIVE (MOBILE)                        */
/* ========================================== */
@media (max-width: 800px) {
  .carousel-container { gap: 10px; }
  .character-card { width: 250px; height: 375px; }
  .nav-btn { width: 40px; height: 40px; font-size: 20px; }
  .carousel-header h2 { font-size: 32px; }
  
  #screen-sheet { padding: 10px; padding-top: 60px; flex-direction: column; }
  .sheet-container { flex-direction: column; height: 88vh; width: 100%; }
  .sheet-image-box { height: 35%; flex: none; display: flex; justify-content: center; align-items: center; }
  .sheet-info-box { height: 65%; padding: 15px; flex: none; overflow-y: auto; }
  
  .sheet-header-info h2 { font-size: 32px; }
  .bio-info { font-size: 12px; flex-wrap: wrap; gap: 10px; }
  .slider-row img { width: 30px; height: 30px; }
  .slider-row label { width: 80px; font-size: 12px; }
  .stat-val { font-size: 16px; width: 25px; }
  
  .sheet-footer { flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
  .sheet-actions { flex-direction: column; }
  .sheet-actions button { width: 100%; }
  
  .btn-back { top: 10px; left: 10px; padding: 8px 15px; font-size: 16px; }
  
  /* CORRECTION DU SCROLL SUR MOBILE POUR LA COMPARAISON */
  #screen-compare {
    justify-content: flex-start; /* Aligne en haut */
    overflow-y: auto; /* Active le scroll */
    padding: 20px 0; /* Laisse de l'espace en haut et en bas */
  }
  .compare-grid { flex-direction: column; }
  .compare-vs { margin: 10px 0; }
}