/* =============================================
   LE PHYSIQUE DE SES IDÉES — Styles du jeu
   ============================================= */

/* PAGE WRAPPER */
.game-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--noir);
}

/* =============================================
   ÉCRAN DE CONFIG
   ============================================= */
.config-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.config-panel {
  background: var(--gris);
  border: 1px solid #333;
  border-top: 4px solid var(--rouge);
  border-radius: 8px;
  padding: 2.5rem;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow);
}

.config-header { text-align: center; margin-bottom: 2.5rem; }
.config-header h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.config-header h1 span { color: var(--rouge); }
.config-header p {
  font-size: 0.9rem;
  color: #999;
  font-style: italic;
}

.config-section { margin-bottom: 2rem; }
.config-section-label {
  display: block;
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gris-clair);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #333;
}

/* Round selector */
.rounds-selector {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.rounds-input {
  background: #111;
  border: 1px solid #444;
  color: var(--blanc);
  font-family: var(--font-title);
  font-size: 2rem;
  letter-spacing: 0.05em;
  width: 80px;
  text-align: center;
  padding: 0.4em 0.2em;
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
}
.rounds-input:focus { border-color: var(--rouge); }
.rounds-hint { font-size: 0.8rem; color: #666; font-style: italic; }

/* Checkboxes style */
.checkbox-group { display: flex; flex-direction: column; gap: 0.6rem; }
.check-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #bbb;
  padding: 0.3rem;
  border-radius: var(--radius);
  transition: color var(--transition);
}
.check-item:hover { color: var(--blanc); }
.check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--rouge);
  cursor: pointer;
}
.check-item input:checked + span { color: var(--blanc); }

/* Partis checkboxes */
.partis-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.parti-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35em 0.75em;
  border: 2px solid currentColor;
  border-radius: 99px;
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity var(--transition), background var(--transition);
  user-select: none;
}
.parti-toggle.active { opacity: 1; }
.parti-toggle .parti-count { font-size: 0.7em; opacity: 0.75; }

.config-submit {
  width: 100%;
  font-size: 1.3rem;
  padding: 1em;
  margin-top: 1rem;
}

/* =============================================
   ÉCRAN DE JEU
   ============================================= */
.game-screen {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.game-screen.active { display: flex; }

/* HUD */
.game-hud {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.round-counter {
  font-family: var(--font-title);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: var(--blanc);
}
.round-counter span { color: var(--rouge); }

.score-display {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #aaa;
  letter-spacing: 0.06em;
}

.sound-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}
.sound-btn:hover { border-color: var(--blanc); color: var(--blanc); }

/* PROGRESS BAR */
.progress-bar {
  width: 100%;
  height: 4px;
  background: #222;
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bleu), var(--rouge));
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* PHOTO DU DÉPUTÉ */
.deputy-photo-wrapper {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  border: 3px solid #333;
  margin-bottom: 2rem;
  position: relative;
  background: #111;
  box-shadow: var(--shadow);
}
.deputy-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.deputy-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: #181818;
  color: #333;
}

/* NOM / PRÉNOM (mode activé) */
.name-guess-fields {
  width: 100%;
  display: none;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.name-guess-fields.visible { display: flex; }
.name-guess-fields input {
  flex: 1;
  background: #111;
  border: 1px solid #333;
  border-radius: var(--radius);
  color: var(--blanc);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.65em 1em;
  outline: none;
  transition: border-color var(--transition);
}
.name-guess-fields input:focus { border-color: var(--rouge); }
.name-guess-fields input::placeholder { color: #555; }

/* SÉLECTEUR DE PARTI */
.parti-selector-label {
  font-family: var(--font-title);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.75rem;
  text-align: center;
}

.parti-buttons {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.parti-btn {
  font-family: var(--font-title);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 0.45em 0.85em;
  border: 2px solid;
  border-radius: 99px;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.parti-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.parti-btn.selected {
  color: var(--noir) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* BOUTON VALIDER */
.validate-btn {
  width: 100%;
  max-width: 400px;
  font-size: 1.3rem;
  padding: 1em;
  background: var(--rouge);
  border-color: var(--rouge);
  color: var(--blanc);
  border-radius: 6px;
  border: none;
  font-family: var(--font-title);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}
.validate-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.validate-btn:not(:disabled):hover { background: #c0001e; transform: translateY(-2px); }
.validate-btn:not(:disabled):active { transform: translateY(0); }

/* =============================================
   POPUP RÉSULTAT
   ============================================= */
.result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}
.result-overlay.active { display: flex; }

.result-popup {
  background: var(--gris);
  border-radius: 8px;
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  border-top: 5px solid var(--rouge);
  animation: popup-in 0.3s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes popup-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.result-verdict {
  font-family: var(--font-title);
  font-size: 2.2rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.result-deputy-photo {
  width: 80px;
  height: 100px;
  border-radius: 4px;
  object-fit: cover;
  object-position: top;
  margin: 1rem auto;
  display: block;
  border: 2px solid #444;
}

.result-deputy-name {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--blanc);
  margin-bottom: 0.2rem;
}
.result-deputy-parti {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.result-deputy-circ {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.result-next-btn {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.9em;
  background: var(--blanc);
  border: none;
  color: var(--noir);
  font-family: var(--font-title);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition);
}
.result-next-btn:hover { background: #ddd; }

/* =============================================
   ÉCRAN DE FIN
   ============================================= */
.end-screen {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}
.end-screen.active { display: flex; }

.end-label {
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: .5rem;
}
.end-sep { color: #444; }
.end-name-score {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: #aaa;
  margin-bottom: 1.5rem;
}
.end-score-big {
  font-family: var(--font-title);
  font-size: clamp(5rem, 20vw, 10rem);
  line-height: 1;
  color: var(--blanc);
  margin-bottom: 0.2rem;
}
.end-score-big span { color: var(--rouge); }
.end-percent {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 1.5rem;
}
.end-comment {
  font-size: 1.1rem;
  color: #bbb;
  font-style: italic;
  margin-bottom: 2rem;
  max-width: 400px;
  line-height: 1.6;
}
.end-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.end-actions .btn { min-width: 160px; }

/* =============================================
   BOUTON LÉGENDE
   ============================================= */
.legend-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3em 0.8em;
  border-radius: 99px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 0.6rem;
}
.legend-btn:hover { border-color: var(--blanc); color: var(--blanc); }

/* =============================================
   MODAL LÉGENDE DES PARTIS
   ============================================= */
.legend-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.legend-overlay.active { display: flex; }

.legend-panel {
  background: var(--gris);
  border: 1px solid #333;
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  animation: popup-in 0.25s cubic-bezier(.34,1.56,.64,1) forwards;
}

.legend-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.legend-header h2 {
  font-size: 1.6rem;
  color: var(--blanc);
  line-height: 1.1;
}
.legend-header p {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  margin-top: 0.3rem;
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
}
.legend-close {
  background: none;
  border: 1px solid #444;
  color: #888;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}
.legend-close:hover { border-color: var(--blanc); color: var(--blanc); }

.legend-scale {
  height: 10px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  /* Ordre corrigé : LFI → GDR → ECO → SOC → centre → droite → RN */
  background: linear-gradient(90deg,
    #FF4466 0%,
    #E05050 14%,
    #33BB66 28%,
    #FF8FAF 40%,
    #D48AD4 50%,
    #FFCC55 62%,
    #5B9BD5 72%,
    #4A90D9 80%,
    #7B68EE 88%,
    #6699FF 100%
  );
}
.legend-scale-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #666;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.legend-list { display: flex; flex-direction: column; gap: 0.5rem; }

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  border-left: 3px solid;
}
.legend-sigle {
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: 0.05em;
  min-width: 72px;
  line-height: 1.2;
}
.legend-info { flex: 1; }
.legend-nom {
  font-size: 0.88rem;
  color: var(--blanc);
  font-weight: bold;
  line-height: 1.3;
}
.legend-desc {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
  margin-top: 0.15rem;
  font-family: var(--font-body);
  line-height: 1.5;
}
.legend-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #666;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}

/* Bouton inline dans la FAQ */
.legend-btn-inline {
  background: none;
  border: 1px solid #555;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.2em 0.6em;
  border-radius: 99px;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color var(--transition), color var(--transition);
}
.legend-btn-inline:hover { border-color: var(--accent); color: var(--blanc); }

/* =============================================
   SECTION SEO / FAQ (contenu visible et lisible)
   ============================================= */
.game-seo {
  background: var(--gris);
  border-top: 1px solid #2a2a2a;
  padding: 4rem 1.5rem 5rem;
}
.game-seo-inner {
  max-width: 800px;
  margin: 0 auto;
}
.game-seo > .game-seo-inner > h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--blanc);
  margin-bottom: 1rem;
}
.game-seo p {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}
.game-seo strong { color: var(--blanc); }

.game-seo-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
.game-seo-col h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
  letter-spacing: 0.08em;
}
.game-seo-col p {
  font-size: 0.88rem;
  color: #999;
  line-height: 1.75;
}

/* FAQ */
.faq-title {
  font-size: 1.3rem;
  color: var(--blanc);
  margin: 2.5rem 0 1rem;
}
.faq-item {
  border-top: 1px solid #2a2a2a;
  padding: 1rem 0;
}
.faq-item:last-child { border-bottom: 1px solid #2a2a2a; }
.faq-q {
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--blanc);
  margin-bottom: 0.4rem;
  cursor: pointer;
}
.faq-a {
  color: #999;
  font-size: 0.88rem;
  line-height: 1.75;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 640px) {
  .config-panel { padding: 3rem; }
  .game-screen { padding: 2.5rem 2rem; }
  .deputy-photo-wrapper { max-width: 360px; }
  .game-seo-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .parti-btn { font-size: 0.72rem; padding: 0.4em 0.7em; }
  .config-panel { padding: 1.8rem 1.3rem; }
}