/* ==========================================================================
   🎯 MODULE PORTRAIT & QUESTIONNAIRE LUDIQUE
   ========================================================================== */

/* --- Conteneur Principal --- */
.portrait-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.portrait-main-title {
  color: var(--text-color);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.portrait-cat-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  vertical-align: middle;
}

.portrait-main-desc {
  color: var(--text-color);
  opacity: 0.75;
  margin-top: 0;
  margin-bottom: 25px;
}

/* --- Alertes & Notifications --- */
.portrait-alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: bold;
  text-align: center;
}

.alert-success {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid #2ecc71;
  color: #2ecc71;
}

.alert-warning {
  background: rgba(230, 126, 34, 0.15);
  border: 1px solid #e67e22;
  color: #d35400;
}
.alert-warning a {
  color: #d35400;
  text-decoration: underline;
}

.alert-danger {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid #e74c3c;
  color: #c0392b;
}

/* --- Panneau Conclusion Notix --- */
.notix-conclusion-box {
  display: flex;
  gap: 20px;
  background: var(--card-bg);
  border: 2px solid #007bff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  align-items: center;
  box-shadow: var(--fiche-shadow);
}

.notix-avatar-wrapper {
  flex: 0 0 120px;
  text-align: center;
}

.notix-avatar-wrapper img {
  width: 200px;
  height: auto;
}

.notix-content {
  flex: 1;
}

.notix-content h3 {
  margin-top: 0;
  color: #007bff;
}

.notix-desc {
  font-style: italic;
  color: var(--text-color);
  line-height: 1.5;
  margin-bottom: 0;
}

.notix-reco-section {
  margin-top: 15px;
  border-top: 1px dashed var(--border-color);
  padding-top: 15px;
}

.notix-reco-section strong {
  color: var(--text-color);
  font-size: 0.95em;
}

.notix-badges-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.badge-link {
  background: var(--section-bg-alt);
  color: #007bff;
  padding: 6px 12px;
  border-radius: 15px;
  text-decoration: none;
  font-size: 0.85em;
  font-weight: bold;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.badge-link:hover {
  background: var(--search-hover);
}

/* --- Blocs des Questions --- */
.no-questions {
  color: var(--text-color);
}

.question-block {
  background: var(--section-bg-alt);
  border: 1px solid var(--border-color);
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.question-title {
  margin-top: 0;
  color: var(--text-color);
  font-size: 1.25em;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* --- Cartes des Choix (Options) --- */
.option-card {
  border: 2px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--card-bg);
  transition: all 0.2s ease;
}

.radio-input-hidden {
  display: none;
}

.option-image {
  width: 80%;
  max-width: 300px;
  height: 220px;
  object-fit: cover;
  object-position: 50% 20%;
  margin-bottom: 12px;
  border-radius: 30%;
  border: 2px solid var(--border-color);
}

.option-title {
  margin: 5px 0;
  font-size: 1.05em;
  color: var(--text-color);
}

.option-desc {
  font-size: 0.88em;
  color: var(--text-color);
  opacity: 0.7;
  margin: 8px 0 0 0;
  line-height: 1.4;
}

/* Éléments Cochés (Sélectionnés) */
.option-card.selected {
  border-color: #007bff;
  background: rgba(0, 123, 255, 0.1);
}

/* Responsive Mobile Section 1 */
@media screen and (max-width: 600px) {
  .notix-conclusion-box {
    flex-direction: column;
    text-align: center;
  }
}


/* ==========================================================================
   🎮 EXTENSION DU MODULE : TU PRÉFÈRES & POSTER CIRCULAIRE
   ========================================================================== */

/* --- Conteneur et Alignement Global --- */
.game-prefere-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.game-intro-header {
  text-align: center;
  margin-bottom: 30px;
}

.game-intro-header h1 {
  font-size: 2.2em;
  color: var(--text-color);
  margin-bottom: 10px;
}

/* --- Onglets de Navigation (Fil d'Ariane) --- */
.game-themes-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 15px;
}

.theme-tab-btn {
  background: var(--section-bg-alt);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: bold;
  transition: transform 0.2s, background 0.2s;
}

.theme-tab-btn:hover {
  background: var(--search-hover);
  transform: translateY(-2px);
}

.theme-tab-btn.active {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

/* --- L'Arène de Duel (Matchmaking) --- */
.game-card-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--fiche-shadow);
  margin-bottom: 40px;
  text-align: center;
}

.duel-arena-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 20px;
  margin: 40px 0;
}

.duel-fighter-card {
  border: 3px solid var(--border-color);
  padding: 25px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--section-bg-alt);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 40%;
  max-width: 320px;
}

.duel-fighter-card:hover {
  border-color: #007bff;
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 123, 255, 0.15);
}

.avatar-circle-wrapper {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--card-bg);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

.avatar-circle-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 20%;
}

.duel-fighter-card h3 {
  margin: 10px 0 0 0;
  font-size: 1.25em;
  color: var(--text-color);
}

.duel-versus-badge {
  background: #e74c3c;
  color: #fff;
  font-weight: 900;
  font-size: 1.4em;
  padding: 12px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
  z-index: 2;
}

/* --- Barre de recherche & suggestions --- */
.out-of-bounds-finder {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 20px auto;
  position: relative;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
}

#custom-choice-input {
	margin-top:20px;
  width: 100%;
  padding: 14px 25px;
  border-radius: 30px;
  border: 2px solid #e0e0e0;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  box-sizing: border-box;
}

#custom-choice-input:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.suggestions-dropdown-box {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #ffffff !important;
  margin-top: 5px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
  border: 1px solid #e0e0e0 !important;
  max-height: 320px;
  overflow-y: auto;
  z-index: 99999 !important;
  box-sizing: border-box;
}

/* Container de la liste déroulante mis à jour */
#elements_proposes_favori {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 6px;
    margin-top: 0px; 
    max-height: 380px; 
    overflow-y: auto;
    overflow-x: hidden;
    
    /* Force la boîte d'autocomplétion à rester sous les fiches de preview (généralement à 999 ou plus) */
    position: absolute;
    z-index: 50; 
}


/* IMPORTANT : Empêche l'image et le texte de casser le mouseenter/mouseleave du container principal */
.suggestion-row-item * {
    pointer-events: none !important;
}

.suggestion-row-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 18px; 
    background-color: #ffffff;
    border-radius: 8px; 
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    
    /* Assure que la ligne capte correctement le curseur */
    pointer-events: auto !important; 
}

/* Dernier élément sans marge basse */
.suggestion-row-item:last-child {
    margin-bottom: 0;
}

/* Effet de survol style Gaming / Pokémon Eau */
.suggestion-row-item:hover {
    background-color: #f0f7ff !important; /* Un bleu très léger qui rappelle l'onglet actif */
    transform: translateX(4px); /* Léger décalage dynamique vers la droite */
}

/* L'image : On passe de 45px à 65px ou 70px pour qu'on voie bien le sprite/artwork */
.suggestion-item-img {
    width: 65px;
    height: 65px;
    object-fit: contain; /* 'contain' évite de couper les Pokémon qui ont des formes complexes (ex: Léviator) */
    background-color: #f8fafc; /* Un fond gris très clair derrière l'image */
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 4px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

/* Petit effet de zoom discret sur l'image quand on survole la ligne */
.suggestion-row-item:hover .suggestion-item-img {
    transform: scale(1.08);
}

/* Contenu textuel */
.suggestion-item-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

/* Le Nom de l'élément (ex: Léviator) */
.suggestion-item-name {
    font-size: 1.15rem; /* Plus grand et lisible */
    font-weight: 700;   /* Plus gras */
    color: #1e293b !important;
}

/* La sous-catégorie (ex: Personnage(s) de fiction) */
.suggestion-item-category {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 3px;
    font-weight: 500;
}

/* --- Alternative Duel Box --- */
.alternative-duel-card {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(155, 89, 182, 0.08) 100%);
  border: 1px dashed #3498db;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin: 20px auto;
  max-width: 600px;
}

/* --- Liste de Classement Interactive (Drag & Drop) --- */
.sortable-ranking-pool {
  list-style: none;
  padding: 0;
  margin: 25px 0;
}

.ranking-item-row {
  display: flex;
  align-items: center;
  background: var(--section-bg-alt);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: grab;
  transition: background 0.15s;
}

.ranking-item-row:active, .ranking-item-row.dragging-active {
  cursor: grabbing;
  background: var(--search-hover);
  opacity: 0.7;
}

/* Match des sélecteurs de badges numériques (#1, #2...) */
.rank-badge, .rank-badge-num {
  background: #007bff;
  color: white;
  font-weight: bold;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 0.9em;
  flex-shrink: 0;
}

/* Dégradé de prestige pour le podium */
.ranking-item-row:nth-child(1) .rank-badge, .ranking-item-row:nth-child(1) .rank-badge-num { background: #f1c40f; color: #000; }
.ranking-item-row:nth-child(2) .rank-badge, .ranking-item-row:nth-child(2) .rank-badge-num { background: #bdc3c7; color: #000; }
.ranking-item-row:nth-child(3) .rank-badge, .ranking-item-row:nth-child(3) .rank-badge-num { background: #e67e22; color: #fff; }

.rank-item-title {
  flex: 1;
  font-weight: 500;
  color: var(--text-color);
}

/* Actions par ligne (Commentaires et Suppression synchronisés avec le JS) */
.rank-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-row-comment, .btn-mini-comment {
  background: none;
  border: none;
  color: #95a5a6;
  font-size: 1.1em;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}
.btn-row-comment.has-comment, .btn-mini-comment.has-comment {
  color: #f1c40f; /* Bulle dorée si remplie */
}
.btn-row-comment:hover, .btn-mini-comment:hover {
  color: #3498db;
}

.btn-row-delete, .btn-mini-delete {
  background: transparent;
  border: none;
  color: #e74c3c;
  font-size: 1.1em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.btn-row-delete:hover, .btn-mini-delete:hover {
  background: rgba(231, 76, 60, 0.1);
}

/* --- Boutons globaux --- */
.btn-submit {
  /* display: block; */
  width: 100%;
  padding: 15px;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
  transition: background 0.2s ease;
}

.btn-submit:hover {
  background: #27ae60;
}

.btn-action-outline {
  background: transparent;
  border: 2px solid #007bff;
  color: #007bff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-outline:hover {
  background: #007bff;
  color: #fff;
}

.btn-danger-action {
  border-color: #e74c3c !important;
  color: #e74c3c !important;
}
.btn-danger-action:hover {
  background: #e74c3c !important;
  color: #fff !important;
}

/* --- Fenêtre Modale de commentaire par ligne --- */
.ranking-comment-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.comment-modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 25px;
  border-radius: 16px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  text-align: left;
}
.comment-modal-box h3 { margin-top: 0; color: var(--text-color); }
.comment-modal-box p { color: var(--text-color); opacity: 0.9; }
.comment-modal-box textarea {
  width: 100%; height: 100px;
  margin: 15px 0; padding: 10px;
  border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--section-bg-alt);
  color: var(--text-color);
  resize: none;
}
.comment-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }


/* 🔔 Fenêtre Modal de validation / Toast de statut --- */
.modal-status-toast {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 15px 35px;
  border-radius: 30px;
  color: #fff;
  background: #34495e; /* Couleur de secours par défaut */
  border: 2px solid #2c3e50;
  font-weight: bold;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideDownFade 0.3s ease-out;
}

.status-success {
  background: #2ecc71 !important;
  border: 2px solid #27ae60 !important;
}

.status-danger {
  background: #e74c3c !important;
  border: 2px solid #c0392b !important;
}

@keyframes slideDownFade {
  from { top: -50px; opacity: 0; }
  to { top: 25px; opacity: 1; }
}


/* --- Le Poster / Rendu en Cercle Géométrique --- */
.section-divider {
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--border-color), rgba(0, 0, 0, 0));
  margin: 50px 0;
}

.poster-circular-canvas {
  position: relative;
  width: 480px;
  height: 480px;
  margin: 40px auto;
  border-radius: 50%;
  border: 2px dashed rgba(0, 123, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-circular-canvas .poster-circle-node {
  pointer-events: auto;
  transition: transform 0.2s ease-in-out;
}

.poster-circular-canvas .poster-circle-node:hover {
  z-index: 9999 !important;
}

.poster-center-core {
  position: absolute;
  width: 130px;
  height: 130px;
  background: var(--card-bg);
  border: 4px solid #007bff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
  z-index: 10;
  text-align: center;
  padding: 10px;
}

.poster-center-core h3 {
  margin: 0;
  font-size: 1.1em;
  color: #007bff;
}

.poster-center-core span {
  font-size: 0.85em;
  font-weight: bold;
  opacity: 0.7;
}

.poster-circle-node {
  position: absolute;
  width: 64px;
  height: 64px;
  background: #2ecc71;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  z-index: 5;
}

.poster-circle-node:hover {
  transform: scale(1.2) !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
  background: #007bff;
}

/* Tooltip / Bulle d'info au survol du poster */
.poster-circle-node .node-tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  font-size: 0.8em;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 20;
}

.poster-circle-node .node-tooltip strong {
  display: block;
  color: #f1c40f;
  margin-bottom: 2px;
}

.poster-circle-node:hover .node-tooltip {
  visibility: visible;
  opacity: 1;
}

.theme-tab-btn.completed {
	background-color: rgba(46, 204, 113, 0.15) !important;
	border-color: #2ecc71 !important;
	color: #27ae60 !important;
}
.theme-tab-btn.completed:hover {
	background-color: rgba(46, 204, 113, 0.3) !important;
}
.theme-tab-btn.active.completed {
	background-color: #2ecc71 !important;
	color: white !important;
}
/* Style du modal de limite duels */
.duel-limit-modal {
	position: fixed;
	top: 0; left: 0; width: 100%; height: 100%;
	background: rgba(0,0,0,0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 11000;
}
/* Thématiques complétées */
.theme-tab-btn.completed {
	background-color: rgba(46, 204, 113, 0.15) !important;
	border-color: #2ecc71 !important;
	color: #27ae60 !important;
}
.theme-tab-btn.completed:hover {
	background-color: rgba(46, 204, 113, 0.3) !important;
}
.theme-tab-btn.active.completed {
	background-color: #2ecc71 !important;
	color: white !important;
}
/* Modales */
.duel-limit-modal, .generic-custom-confirm-modal {
	position: fixed;
	top: 0; left: 0; width: 100%; height: 100%;
	background: rgba(0,0,0,0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 11000;
}
/* Point 4 : Structure Podium */
.podium-container {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 20px;
	margin: 30px auto;
	max-width: 600px;
	padding: 20px;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 12px;
}
.podium-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	transition: all 0.3s ease;
}
.podium-avatar {
	position: relative;
	width: 70px;
	height: 70px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #ccc;
	background: #fff;
	box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.podium-step.step-1 .podium-avatar {
	width: 95px;
	height: 95px;
	border-color: #f1c40f;
	box-shadow: 0 6px 15px rgba(241, 196, 15, 0.3);
}
.podium-step.step-2 .podium-avatar { border-color: #bdc3c7; }
.podium-step.step-3 .podium-avatar { border-color: #e67e22; }

.podium-column {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: bold;
	font-size: 1.5em;
	border-radius: 6px 6px 0 0;
	margin-top: 10px;
	box-shadow: inset 0 2px 5px rgba(255,255,255,0.2);
}
.podium-step.step-1 .podium-column { background: linear-gradient(to top, #f1c40f, #f39c12); height: 110px; order: 2; }
.podium-step.step-2 .podium-column { background: linear-gradient(to top, #bdc3c7, #95a5a6); height: 80px; order: 1; }
.podium-step.step-3 .podium-column { background: linear-gradient(to top, #e67e22, #d35400); height: 60px; order: 3; }

/* Réorganisation visuelle de l'affichage du podium par la propriété CSS "order" */
.podium-step.step-1 { order: 2; }
.podium-step.step-2 { order: 1; }
.podium-step.step-3 { order: 3; }

.podium-label {
	margin-top: 8px;
	font-size: 0.9em;
	font-weight: 600;
	text-align: center;
	max-width: 120px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}


/* --- Responsive Mobile Général --- */
@media screen and (max-width: 768px) {
  .duel-arena-wrapper {
    flex-direction: column;
  }
  .duel-fighter-card {
    width: 90%;
  }
  .poster-circular-canvas {
    width: 300px;
    height: 300px;
  }
}