/* Survey
================================================== */
.overlay-content.overlay-type-survey {display:flex; flex-direction:column; width:clamp(20rem, 90vw, 52rem); max-height:min(90vh, 48rem); padding:0; overflow:hidden;}
.survey {display:flex; flex:1 1 auto; flex-direction:column; min-height:0;}
.survey-header {display:flex; flex:0 0 auto; flex-direction:column; gap:0.25rem; padding:var(--margin-large) var(--margin-large) var(--margin-medium); border-bottom:1px solid var(--separator-bordercolor);}
.survey-body {display:flex; flex:1 1 auto; flex-direction:column; gap:var(--margin-large); min-height:0; padding:var(--margin-large); overflow-y:auto;}
.survey-actions {display:flex; flex:0 0 auto; align-items:center; justify-content:space-between; gap:var(--margin-small); padding:var(--margin-small) var(--margin-large); border-top:1px solid var(--separator-bordercolor);}

/* Survey - Question */
.survey-question {display:flex; flex-direction:column; gap:0.5rem; max-width:44rem;}
.survey-label {font-weight:700; line-height:1.5em;}
.survey-required {color:var(--app-color-content-alert-error-normal);}
/* Gris foncé : --color-content-neutral-secondary (#B5B7BA) n'atteint pas le contraste 4.5:1 sur fond clair. */
.survey-help {font-size:0.875em; color:var(--color-content-neutral-tertiary, #4A5578);}
.survey-error {font-size:0.875em; color:var(--app-color-content-alert-error-normal);}

/* Survey - Options */
.survey-options {display:grid; grid-template-columns:1fr; gap:0.5rem;}
.survey-options.survey-options-grid {grid-template-columns:repeat(auto-fit, minmax(16rem, 1fr));}

.survey-option {display:flex; align-items:center; padding:0.75rem 1rem; font-weight:400; border-radius:0.5rem; border:1px solid var(--color-stroke-default); color:var(--game-answer-item-color); background-color:var(--game-answer-item-bgcolor); cursor:pointer;}
.survey-option:hover {color:var(--game-answer-item-hover-color); background-color:var(--game-answer-item-hover-bgcolor);}
.survey-option:focus-within {box-shadow:0 0 8px 4px var(--button-focus-shadowcolor);}
.survey-option:has(input:checked) {color:var(--game-answer-item-selected-color); background-color:var(--game-answer-item-selected-bgcolor); border-color:var(--game-answer-item-selected-bgcolor);}
.survey-option > span {word-break:break-word;}
.survey-question:has(.survey-error) .survey-option {border-color:var(--app-color-content-alert-error-normal);}

/* Survey - Scale */
.survey-scale {display:grid; grid-template-columns:repeat(var(--survey-scale-points, 5), 1fr); gap:0.5rem;}
.survey-scale-point {display:flex; position:relative; justify-content:center; padding:0.75rem 0; font-weight:600; border-radius:0.5rem; border:1px solid var(--color-stroke-default); color:var(--game-answer-item-color); background-color:var(--game-answer-item-bgcolor); cursor:pointer;}
.survey-scale-point:hover {color:var(--game-answer-item-hover-color); background-color:var(--game-answer-item-hover-bgcolor);}
.survey-scale-point:focus-within {box-shadow:0 0 8px 4px var(--button-focus-shadowcolor);}
.survey-scale-point:has(input:checked) {color:var(--game-answer-item-selected-color); background-color:var(--game-answer-item-selected-bgcolor); border-color:var(--game-answer-item-selected-bgcolor);}
.survey-scale-point input {position:absolute; width:1px; height:1px; margin:0; opacity:0;}

/* Survey - Free text */
.survey-question textarea {resize:vertical; min-height:5rem;}
.survey-counter {font-size:0.875em; text-align:right; color:var(--color-content-neutral-tertiary, #4A5578);}

#overlay-survey {top:var(--survey-overlay-top, 0); height:auto;}

.survey-legend-item {display:inline-flex; align-items:center; gap:0.25rem;}
.survey-legend-marker {display:inline-flex; align-items:center; justify-content:center; width:1.125rem; height:1.125rem; border-radius:0.25rem; border:1px solid transparent; font-weight:700; font-size:0.75rem;}


/* Salle d'attente du maitre du jeu */
#prof-waiting-room {display:flex; flex-direction:column; gap:var(--margin-medium, 1.5rem); width:100%; text-align:left;}
#prof-waiting-room > h2 {margin:0;}

/* Tuiles */
#prof-waiting-room .waiting-kpi-group {display:grid; grid-template-columns:repeat(auto-fit, minmax(16rem, 1fr)); gap:var(--margin-medium, 1.5rem);}
#prof-waiting-room .waiting-kpi {display:flex; justify-content:space-between; align-items:center; gap:var(--margin-medium, 1.5rem); padding:1.25rem 1.5rem; border-radius:0.75rem; border:1px solid var(--color-content-primary-light); background:var(--color-background-light-neutral-ground);}
#prof-waiting-room .waiting-kpi-text {display:flex; flex-direction:column; gap:0.25rem;}
#prof-waiting-room .waiting-kpi-label {font-size:1.125rem; font-weight:500;}
#prof-waiting-room .waiting-kpi-hint {font-size:0.875rem; color:var(--color-content-neutral-tertiary, #4A5578);}
#prof-waiting-room .waiting-kpi-value {font-size:2rem; font-weight:700; white-space:nowrap;}

/* Groupes de joueurs */
#prof-waiting-room .player-group {display:flex; flex-direction:column; gap:0.75rem; width:100%;}
#app.game-environment #prof-waiting-room .player-group-title {margin:0; font-family:var(--font-roboto); font-size:1rem; font-weight:700; text-transform:uppercase; letter-spacing:0.02em;}
#prof-waiting-room .tag-container {justify-content:flex-start;}

/* Pied : legende a gauche, bouton a droite */
#prof-waiting-room .waiting-footer {display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:var(--margin-medium, 1.5rem); padding-top:var(--margin-medium, 1.5rem); border-top:1px solid var(--color-content-primary-light);}
#prof-waiting-room .waiting-legend {display:flex; flex-wrap:wrap; align-items:center; gap:1.25rem; font-size:0.875rem; color:var(--color-content-neutral-tertiary, #4A5578);}


/* Etapes du joueur*/

/* Icone « sondage complete » : clipboard-check de Tabler Icons (licence MIT, tabler.io/icons). */
:root {--icon-survey-done:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2'/><path d='M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z'/><path d='M9 14l2 2l4 -4'/></svg>");}

.tag.tag-player-name.tag-not-ready,
.survey-legend-marker.legend-marker-not-ready {color:var(--color-content-neutral-tertiary, #4A5578); background-color:transparent; border-style:dashed; border-color:var(--color-content-neutral-secondary);}

.tag.tag-player-name.tag-survey-done,
.survey-legend-marker.legend-marker-survey-done {color:var(--tag-informative-color); background-color:var(--tag-informative-bgcolor); border-style:dashed; border-color:var(--tag-informative-bordercolor);}

.tag.tag-player-name.tag-ready,
.survey-legend-marker.legend-marker-ready {color:var(--tag-positive-color); background-color:var(--tag-positive-bgcolor); border-style:solid; border-color:var(--tag-positive-bordercolor);}

.tag.tag-player-name:is(.tag-not-ready, .tag-survey-done, .tag-ready)::before {display:inline-block; margin-right:0.375rem; font-weight:700;}
.tag-not-ready::before,   .legend-marker-not-ready::before {content:"\25CB";}
.tag-ready::before,       .legend-marker-ready::before     {content:"\2713";}
.tag-survey-done::before,
.legend-marker-survey-done::before {content:""; width:1em; height:1em; background-color:currentColor; -webkit-mask:var(--icon-survey-done) center / contain no-repeat; mask:var(--icon-survey-done) center / contain no-repeat;}
.legend-marker-survey-done::before {width:0.8em; height:0.8em;}


/* Bilan du sondage*/

/* Conteneur et en-tete */
#prof-waiting-room .survey-summary {display:flex; flex-direction:column; gap:1rem; box-sizing:border-box; width:100%; padding:1.25rem 1.5rem; border-radius:0.75rem; border:1px solid var(--color-content-primary-light); background:#FFFFFF;}
/* Largeur identique a la tuile « Prets a jouer » (grille de 2 colonnes, meme gap), replie OU deplie.
   min-width : sur ecran etroit, les tuiles s'empilent ; le bilan ne descend pas sous 16rem. */
#prof-waiting-room .survey-summary-header {display:flex; justify-content:space-between; align-items:baseline; gap:1rem;}
#app.game-environment #prof-waiting-room .survey-summary-header h3 {margin:0; font-family:var(--font-roboto); font-size:1rem; font-weight:600;}
#prof-waiting-room .survey-summary-count {margin-left:0.5rem; font-weight:400; color:var(--color-content-neutral-tertiary, #4A5578);}
#prof-waiting-room .survey-summary-toggle {background:none; border:0; border-radius:0; box-shadow:none; padding:0.25rem 0; font:inherit; font-size:0.875rem; color:var(--color-content-neutral-tertiary, #4A5578); text-decoration:underline; text-underline-offset:3px; cursor:pointer;}

/* Questions l'une sous l'autre */
#prof-waiting-room .survey-summary-grid {display:flex; flex-direction:column; gap:1rem;}
#prof-waiting-room .summary-question {display:flex; flex-direction:column; gap:0.5rem; padding-top:0.75rem; border-top:1px solid #EEF2F8;}
#prof-waiting-room .summary-question-label {font-size:0.875rem; font-weight:600; line-height:1.4;}
#prof-waiting-room .summary-note {margin:0; font-size:0.8125rem; color:var(--color-content-neutral-tertiary, #4A5578);}

#prof-waiting-room .summary-options {display:flex; flex-direction:column; gap:0.375rem;}
#prof-waiting-room .summary-option.progressbar {display:flex; align-items:center; gap:1rem; font-size:0.8125rem;}
#prof-waiting-room .summary-option .pb-labels {flex:0 0 38%; min-width:0;}
#prof-waiting-room .summary-option .pb-topic {flex:1 1 auto; min-width:0;}
#prof-waiting-room .summary-option .pb-value {flex:0 0 4.5rem; white-space:nowrap; text-align:right; font-variant-numeric:tabular-nums;}
/* Fond visible : sans lui, un choix a 0 n'aurait aucune barre a droite de son libelle. */
#prof-waiting-room .summary-option .pb-track {flex:1 1 auto; height:0.5rem; border:0; border-radius:0 0.25rem 0.25rem 0; background-color:#E4E9F2;}
#prof-waiting-room .summary-option .pb-progress {border-radius:0 0.25rem 0.25rem 0;}

/* Choix le plus selectionne en gras ; choix a 0 en gris (contraste >= 4.5:1) */
#prof-waiting-room .summary-option.is-top .pb-topic {font-weight:600;}
#prof-waiting-room .summary-option.is-zero .pb-labels > *, #prof-waiting-room .summary-option.is-zero .pb-value {color:#6B7490; font-weight:400;}

/* Ecran etroit : libelle au-dessus de la barre */
@media only screen and (max-width: 1080px) {
    #prof-waiting-room .summary-option.progressbar {display:block;}
    #prof-waiting-room .summary-option .pb-track {margin-top:0.25rem;}
    #prof-waiting-room .summary-option .pb-value {display:block; margin-top:0.125rem; text-align:left;}
}