/* Styles des pages, chargés via AssetMapper. Les couleurs viennent des variables de base.html.twig. */

/* Listes et titres */
.entete-liste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: 0 0 1rem; }
.entete-liste h1 { margin: 0; }
.recherche { flex: 1 1 14rem; max-width: 22rem; }
.recherche input { width: 100%; font-size: 1rem; padding: .6rem .85rem; border: 1px solid var(--ligne); border-radius: 999px; background: var(--surface); }
.recherche input:focus { outline: 3px solid var(--accent-doux); border-color: var(--accent); }
.fil { margin: 0 0 .4rem; color: var(--doux); font-size: .9rem; }
.fil a { text-decoration: none; }
.centre { text-align: center; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; letter-spacing: .08em; }

.grille-quizz { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.carte-quizz, .carte-partie { display: flex; align-items: center; gap: .85rem; padding: .75rem .9rem; border: 1px solid var(--ligne); border-radius: 14px;
                              background: var(--surface); text-decoration: none; transition: border-color .15s, transform .1s; }
.carte-quizz:hover, .carte-partie:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--ligne)); }
.carte-quizz:active { transform: scale(.99); }
.carte-emoji { font-size: 1.9rem; line-height: 1; flex: none; }
.carte-quizz .corps { display: flex; flex-direction: column; min-width: 0; }
.carte-quizz .titre { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.carte-quizz .details, .carte-partie .details { color: var(--doux); font-size: .85rem; }
.carte-partie { flex-wrap: wrap; gap: .3rem .6rem; }
.carte-partie .details { flex-basis: 100%; }
.liste-simple { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }

.vide { border: 1px dashed var(--ligne); border-radius: 18px; padding: 2rem 1.25rem; text-align: center; color: var(--doux); }
.vide p { margin: .3rem 0; }
.vide .bouton { margin-top: .75rem; }
.vide-emoji { font-size: 2.2rem; }

/* Fiche d'un quizz */
.fiche-haut { display: flex; gap: 1rem; align-items: center; margin: .25rem 0 1rem; }
.grand-emoji { font-size: 3rem; line-height: 1; margin: 0; }
.fiche-titre { min-width: 0; }
.meta { margin: 0; color: var(--doux); font-size: .92rem; }
.bloc { margin: 0 0 1.4rem; }
.bloc h2 { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 0 0 .5rem; }
.texte { margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions form { margin: 0; }
.actions.centre { justify-content: center; }

.questions { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.carte-question { border: 1px solid var(--ligne); border-radius: 14px; background: var(--surface); padding: .8rem .9rem; scroll-margin-top: 5rem; }
.question-haut { display: flex; gap: .7rem; align-items: baseline; }
.numero { flex: none; display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 999px; background: var(--accent-doux); color: var(--accent); font-weight: 700; font-size: .9rem; }
.enonce { margin: 0; font-weight: 600; flex: 1; overflow-wrap: anywhere; }
.duree { flex: none; color: var(--doux); font-size: .85rem; white-space: nowrap; }
.reponses-apercu { list-style: none; margin: .55rem 0 0 2.5rem; padding: 0; display: grid; gap: .2rem; font-size: .93rem; color: var(--doux); }
.reponses-apercu .bonne { color: var(--ok); font-weight: 600; }
.explication { margin: .5rem 0 0 2.5rem; color: var(--doux); font-size: .9rem; font-style: italic; }
.question-actions { display: flex; gap: .3rem; justify-content: flex-end; margin-top: .4rem; }
.question-actions form { margin: 0; }
.bouton-rond { display: inline-grid; place-items: center; min-height: 2.4rem; min-width: 2.4rem; padding: .3rem; border-radius: 999px; font-size: 1rem;
               border: 1px solid var(--ligne); background: transparent; text-decoration: none; }
.bouton-rond:hover { background: var(--fond); }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; border: 1px solid var(--accent);
          border-radius: 12px; padding: .6rem 1.15rem; background: var(--accent); color: var(--sur-accent); font-weight: 600; text-decoration: none; }
.bouton:hover { filter: brightness(1.06); }
.bouton-discret { background: transparent; color: var(--encre); border-color: var(--ligne); }
.bouton-supprimer { margin-left: auto; }
.lien-discret { border: 0; background: none; color: var(--doux); text-decoration: underline; padding: .4rem; font-size: .9rem; }

/* Formulaires */
.formulaire label, .formulaire legend { display: block; font-weight: 600; margin: 1.1rem 0 .4rem; padding: 0; }
.formulaire label.petit { font-weight: 500; font-size: .9rem; margin-top: .7rem; }
.formulaire .facultatif { color: var(--doux); font-weight: 400; font-size: .85rem; margin-left: .3rem; }
.formulaire :is(input[type="text"], textarea), .saisie-code input, .rejoindre input[type="text"] {
    width: 100%; font-size: 1rem; padding: .7rem .8rem; border: 1px solid var(--ligne); border-radius: 12px; background: var(--surface); }
.formulaire input.court { max-width: 8rem; }
.formulaire textarea { resize: vertical; min-height: 3.2rem; line-height: 1.5; }
.formulaire :is(input, textarea):focus, .rejoindre input:focus { outline: 3px solid var(--accent-doux); border-color: var(--accent); }
.formulaire .actions { margin-top: 1.5rem; }
.groupe-choix { border: 0; margin: 0; padding: 0; min-width: 0; }
.segments { display: flex; flex-wrap: wrap; gap: .35rem; }
.formulaire .segment { margin: 0; font-weight: 500; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .4rem .85rem; border: 1px solid var(--ligne);
                border-radius: 999px; background: var(--surface); cursor: pointer; white-space: nowrap; }
.emojis .segment span { font-size: 1.25rem; padding-inline: .6rem; }
.segment input:checked + span { border-color: var(--accent); background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.segment input:focus-visible + span { outline: 3px solid var(--accent); }
.reponses-saisie { display: grid; gap: .45rem; }
.ligne-reponse { display: flex; gap: .5rem; align-items: center; }
.formulaire .bonne-case { margin: 0; flex: none; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 12px;
                          border: 2px solid var(--ligne); background: var(--surface); cursor: pointer; font-size: 1.2rem; }
.bonne-case input { position: absolute; opacity: 0; pointer-events: none; }
.bonne-case:has(input:checked) { border-color: var(--ok); background: var(--ok-doux); }
.bonne-case:has(input:checked)::after { content: "✓"; position: absolute; transform: translate(.9rem, .9rem); color: var(--ok); font-weight: 800; font-size: .9rem; }
.bonne-case:has(input:focus-visible) { outline: 3px solid var(--accent); }

/* Panneaux (Préférences, connexion, rejoindre) */
.panneau { background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px; padding: 1.25rem; margin-bottom: 1.25rem; }
.panneau h2 { font-size: 1.05rem; margin: 0 0 .9rem; }
.panneau h3 { font-size: 1rem; margin: 1.2rem 0 0; }
.details { color: var(--doux); font-size: .9rem; margin: .7rem 0 0; }
.panneau ol { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--doux); font-size: .95rem; }
.panneau li + li { margin-top: .3rem; }
.choix-theme { border: 0; margin: 0 0 1.1rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.option-theme { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border: 1px solid var(--ligne); border-radius: 12px;
                background: var(--fond); font-weight: 600; cursor: pointer; }
.option-theme:has(input:checked) { border-color: var(--accent); outline: 2px solid var(--accent-doux); }
.option-theme input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; margin: 0; }
/* Choix de la version (téléphone ou Android TV) : boutons radio, sans JavaScript. */
.choix-appli { display: inline-flex; margin: 0 0 1.1rem; border: 1px solid var(--ligne); border-radius: 999px; overflow: hidden; background: var(--fond); }
.choix-appli label { padding: .55rem 1.15rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.choix-appli label + label { border-left: 1px solid var(--ligne); }
#appli-telephone:checked ~ .choix-appli label[for="appli-telephone"],
#appli-tv:checked ~ .choix-appli label[for="appli-tv"] { background: var(--accent); color: var(--sur-accent); }
.version-appli { display: none; }
#appli-telephone:checked ~ .version-telephone, #appli-tv:checked ~ .version-tv { display: block; }
.adresse-tv { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 12px; background: var(--fond); border: 1px dashed var(--accent); }
.adresse-tv strong { display: block; font-size: 1.15rem; letter-spacing: .02em; word-break: break-all; margin-top: .2rem; }
.form-adresse-tv { margin: 1rem 0 0; }
@media (max-width: 420px) {
    .choix-theme { grid-template-columns: 1fr; }
    .panneau .bouton { width: 100%; }
    .choix-appli { display: flex; } .choix-appli label { flex: 1; text-align: center; padding-inline: .5rem; }
}

.connexion, .rejoindre { max-width: 380px; margin: 1.5rem auto; text-align: center; }
.connexion-emoji { font-size: 2.6rem; line-height: 1; margin: .25rem 0 .75rem; }
.connexion label, .rejoindre label { display: block; font-weight: 600; margin: 1rem 0 .35rem; text-align: left; }
.connexion input[type="password"] { width: 100%; font-size: 1.1rem; padding: .75rem .85rem; border: 1px solid var(--ligne);
                                    border-radius: 12px; background: var(--fond); }
.connexion input:focus { outline: 3px solid var(--accent-doux); border-color: var(--accent); }
.connexion .bouton, .rejoindre .bouton { width: 100%; margin-top: 1rem; padding: .85rem; font-size: 1.05rem; }
.erreur { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); padding: .7rem .9rem; border-radius: 12px; margin: 0 0 .9rem; text-align: left; }
.saisie-code { margin-top: .8rem; }
.saisie-code input { text-align: center; font-size: 1.8rem !important; letter-spacing: .3em; text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; padding: .6rem; }
.bouton-scanner { font-size: 1.15rem !important; padding: 1.1rem !important; }
.scanner:not([hidden]) + .sans-scanner { display: none; }

/* ——— Écran de la partie (ordinateur, vidéoprojecteur, TV) ——— */
.ecran { max-width: 80rem; margin: 0 auto; }
.ecran-haut { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.5rem; margin: 0 0 1rem; color: var(--doux); font-weight: 600; }
.ecran-haut p { margin: 0; }
.ecran-quizz { flex: 1; color: var(--encre); }
.ecran-code strong { font-family: ui-monospace, Menlo, monospace; letter-spacing: .1em; color: var(--accent); }

.attente { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem; align-items: center; }
.rejoindre-qr { background: #fff; border-radius: 22px; padding: 1rem; aspect-ratio: 1; display: grid; place-items: center; box-shadow: 0 20px 60px -30px rgba(0,0,0,.6); }
.rejoindre-qr img { width: 100%; height: auto; display: block; }
.rejoindre-texte h1 { font-size: clamp(1.5rem, 3.2vw, 2.6rem); margin: 0 0 .4rem; }
.consigne { color: var(--doux); font-size: clamp(1rem, 1.5vw, 1.3rem); margin: 0; }
.grand-code { font-family: ui-monospace, Menlo, monospace; font-size: clamp(2.6rem, 7vw, 5.5rem); font-weight: 800; letter-spacing: .14em; color: var(--accent); margin: .2rem 0 1rem; line-height: 1.1; }
.titre-joueurs { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 0 0 .5rem; }
.joueurs { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.joueurs li { padding: .4rem .95rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--ligne); font-weight: 600; font-size: clamp(1rem, 1.4vw, 1.25rem); }
.joueurs .en-attente { color: var(--doux); font-weight: 400; border-style: dashed; }
.joueur-arrive { animation: arrivee .35s ease-out; }
@keyframes arrivee { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 760px) { .attente { grid-template-columns: 1fr; } .rejoindre-qr { max-width: 22rem; margin: 0 auto; } }

.bouton-ecran { font-size: clamp(1.05rem, 1.6vw, 1.4rem); padding: .8rem 1.8rem; border-radius: 14px; }
.action-ecran { margin: 1.2rem 0 0; }
.question-ecran .action-ecran, .fin .action-ecran { display: flex; justify-content: center; }
.fin .actions .action-ecran { margin: 0; }
.arreter { margin: 2rem 0 0; text-align: center; }

.question-ecran { display: flex; flex-direction: column; gap: 1rem; }
.enonce-ecran { font-size: clamp(1.5rem, 3.6vw, 3rem); line-height: 1.2; text-align: center; margin: .5rem auto 0; max-width: 60rem; overflow-wrap: anywhere; }
.compteurs { display: flex; justify-content: center; align-items: center; gap: 3rem; }
.chrono { margin: 0; display: grid; place-items: center; width: clamp(4.5rem, 9vw, 7rem); aspect-ratio: 1; border-radius: 999px;
          border: .35rem solid var(--accent); font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.chrono.fin-proche { border-color: var(--danger); color: var(--danger); }
.nb-reponses { margin: 0; text-align: center; font-size: clamp(1.4rem, 3vw, 2.4rem); line-height: 1.1; }
.nb-reponses span { font-size: .5em; color: var(--doux); }
.choix-ecran { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.choix-tuile { position: relative; display: flex; align-items: center; gap: .9rem; min-height: clamp(4rem, 9vh, 7rem); padding: .8rem 1.2rem; border-radius: 16px;
               color: #fff; font-weight: 700; font-size: clamp(1.1rem, 2.2vw, 2rem); overflow: hidden; overflow-wrap: anywhere; }
.choix-tuile .symbole { font-size: 1.2em; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.r0 { --couleur: var(--r0); } .r1 { --couleur: var(--r1); } .r2 { --couleur: var(--r2); } .r3 { --couleur: var(--r3); }
.choix-tuile { background: var(--couleur); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.correction .choix-tuile.fausse { opacity: .35; }
.correction .choix-tuile.bonne { box-shadow: 0 0 0 .3rem var(--fond), 0 0 0 .55rem var(--ok); }
.choix-tuile .barre { position: absolute; left: 0; bottom: 0; height: .45rem; width: var(--part); background: rgba(255,255,255,.75); transition: width .6s; }
.choix-tuile .votes { margin-left: auto; font-size: .9em; background: rgba(0,0,0,.25); border-radius: 999px; padding: .1rem .7rem; }
.explication-ecran { text-align: center; color: var(--doux); font-size: clamp(1rem, 1.8vw, 1.5rem); margin: 0; }
.classement-court { list-style: none; margin: .4rem auto 0; padding: 0; width: min(100%, 34rem); display: grid; gap: .35rem; }
.classement-court li { display: flex; align-items: center; gap: .8rem; padding: .45rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--ligne);
                       font-size: clamp(1rem, 1.6vw, 1.35rem); }
.classement-court .rang { width: 1.8rem; font-weight: 800; color: var(--accent); }
.classement-court .nom { flex: 1; font-weight: 600; }
.classement-court .score { font-variant-numeric: tabular-nums; font-weight: 700; }
.classement-court .gain { color: var(--ok); font-weight: 700; font-size: .85em; }
@media (max-width: 560px) { .choix-ecran { grid-template-columns: 1fr; } }

.fin { text-align: center; }
.fin h1 { font-size: clamp(1.6rem, 4vw, 3rem); }
.podium { list-style: none; margin: 2rem auto 1.5rem; padding: 0; display: flex; justify-content: center; align-items: flex-end; gap: 1rem; }
.podium li { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .3rem; width: min(30%, 14rem); padding: 1rem .5rem;
             border-radius: 18px 18px 6px 6px; background: var(--surface); border: 1px solid var(--ligne); }
.podium .place-1 { order: 2; min-height: 15rem; border-color: var(--accent); background: var(--accent-doux); }
.podium .place-2 { order: 1; min-height: 12rem; }
.podium .place-3 { order: 3; min-height: 10rem; }
.podium .medaille { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; }
.podium .nom { font-weight: 800; font-size: clamp(1.1rem, 2.4vw, 2rem); overflow-wrap: anywhere; }
.podium .score { color: var(--doux); font-weight: 600; }
.classement-court.suite { margin-bottom: 1.5rem; }

/* ——— Téléphone du joueur ——— */
.telephone { max-width: 30rem; margin: 0 auto; }
.telephone-haut { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; font-weight: 600; }
.mon-score { color: var(--accent); white-space: nowrap; }
.message-jeu { text-align: center; padding: 1.5rem 0; }
.message-jeu h1 { margin: .4rem 0; }
.message-jeu p { margin: .4rem 0; }
.message-jeu.gagne h1 { color: var(--ok); }
.gain-telephone { font-size: 2rem; font-weight: 800; color: var(--accent); }
.message-jeu .explication { margin: 1rem 0 0; }
.repondre-haut { display: flex; justify-content: space-between; align-items: center; color: var(--doux); font-weight: 600; }
.petit-chrono { font-variant-numeric: tabular-nums; }
.petit-chrono.fin-proche { color: var(--danger); }
.enonce-telephone { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin: .6rem 0 1rem; overflow-wrap: anywhere; }
.boutons-reponse { display: grid; gap: .7rem; }
.bouton-reponse { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 4.5rem; padding: .8rem 1rem; border: 0; border-radius: 16px;
                  background: var(--couleur); color: #fff; font-weight: 700; font-size: 1.15rem; text-align: left; text-shadow: 0 1px 2px rgba(0,0,0,.35);
                  transition: transform .08s, filter .15s; overflow-wrap: anywhere; }
.bouton-reponse:active { transform: scale(.97); }
.bouton-reponse .symbole { font-size: 1.5rem; flex: none; }
.boutons-reponse.envoye .bouton-reponse { filter: grayscale(.7) brightness(.8); pointer-events: none; }

/* ——— Télévision : grandes cartes à choisir à la télécommande ——— */
.tv-titre { font-size: 2.2rem; margin: .5rem 0 .2rem; }
.tv-section { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 1.6rem 0 .6rem; }
.grille-tv { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.grille-tv form { margin: 0; height: 100%; }
.carte-tv { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; padding: 1.1rem 1.2rem; border: .15rem solid var(--ligne);
            border-radius: 18px; background: var(--surface); color: var(--encre); text-align: left; text-decoration: none; transition: transform .15s, border-color .15s; }
.carte-tv .carte-emoji { font-size: 2.6rem; }
.carte-tv .titre { font-weight: 700; font-size: 1.2rem; line-height: 1.25; }
.carte-tv .details { color: var(--doux); font-size: .9rem; }
.carte-tv:focus { transform: scale(1.05); border-color: var(--accent); outline: none; box-shadow: 0 0 0 .2rem var(--accent); }
html.tv .lien-quitter-tv { font-size: .8rem; color: var(--doux); }
html.tv .ecran { max-width: none; }
html.tv .bouton:focus, html.tv .bouton-ecran:focus { box-shadow: 0 0 0 .25rem var(--fond), 0 0 0 .5rem var(--accent); outline: none; transform: scale(1.04); }
html.tv .rejoindre-qr { max-width: 30rem; }
html.tv .arreter { margin-top: 1rem; }
