/* =====================================================================
   electricitedomotique.fr — QUIZ · FEUILLE DE STYLE
   Tous les sélecteurs sont préfixés par .edq : le quiz peut être intégré
   dans une page du site sans en perturber le style.
   Pour changer l'identité visuelle, modifiez les variables ci-dessous.
   ===================================================================== */

.edq {
  --bleu: #0b5fff;        /* bleu électrique : actions, progression */
  --bleu-clair: #e6efff;
  --nuit: #0a1f44;        /* bleu foncé : titres, en-tête */
  --jaune: #ffc400;       /* accent : XP, récompenses */
  --jaune-clair: #fff6d1;
  --fond: #f4f7fb;
  --carte: #ffffff;
  --texte: #14233f;
  --doux: #5c6b85;
  --trait: #dfe6f1;
  --vert: #0f9d58;
  --vert-clair: #e2f6ea;
  --rouge: #e03131;
  --rouge-clair: #fde8e8;
  --rayon: 18px;
  --ombre: 0 2px 4px rgba(10, 31, 68, .05), 0 10px 26px rgba(10, 31, 68, .07);

  box-sizing: border-box;
  min-height: 100vh;
  margin: 0;
  padding: 0 0 48px;
  background: var(--fond);
  color: var(--texte);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body:has(> .edq) { margin: 0; }
.edq *, .edq *::before, .edq *::after { box-sizing: border-box; }
.edq h1, .edq h2, .edq h3, .edq p { margin: 0; }
.edq button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
.edq button:focus-visible, .edq input:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.edq .wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ───────── En-tête ───────── */
.edq .top { background: var(--nuit); color: #fff; position: sticky; top: 0; z-index: 20; }
.edq .top .wrap { display: flex; align-items: center; gap: 12px; height: 58px; }
.edq .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; font-size: 15px; }
.edq .logo i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--jaune); color: var(--nuit); font-style: normal; font-size: 19px; }
.edq .logo small { display: block; font-weight: 500; font-size: 11px; opacity: .7; letter-spacing: .02em; }
.edq .chip-xp { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.edq .chip-xp b { color: var(--jaune); }

/* ───────── Onglets ───────── */
.edq .tabs { background: var(--carte); border-bottom: 1px solid var(--trait); position: sticky; top: 58px; z-index: 19; }
.edq .tabs .wrap { display: flex; gap: 4px; }
.edq .tab { flex: 1; padding: 12px 4px 10px; font-size: 13px; font-weight: 600; color: var(--doux); border-bottom: 3px solid transparent; min-height: 48px; }
.edq .tab[aria-current="true"] { color: var(--bleu); border-bottom-color: var(--bleu); }

/* ───────── Vues et transitions ───────── */
.edq .vue { padding-top: 20px; animation: edq-entree .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes edq-entree { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.edq .glisse { animation: edq-glisse .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes edq-glisse { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }

.edq .carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; margin-bottom: 16px; }
.edq .titre-section { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--doux); margin: 22px 4px 10px; }
.edq .note { font-size: 13px; color: var(--doux); }

/* ───────── Accueil ───────── */
.edq .hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #0a1f44 0%, #0b3fae 60%, #0b5fff 100%); color: #fff; border-radius: 24px; padding: 28px 22px 24px; margin-bottom: 16px; }
.edq .hero::after { content: "⚡"; position: absolute; right: -8px; top: -30px; font-size: 170px; opacity: .1; transform: rotate(12deg); pointer-events: none; }
.edq .hero h1 { font-size: clamp(26px, 6.2vw, 38px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; max-width: 14em; text-wrap: balance; }
.edq .hero h1 em { font-style: normal; color: var(--jaune); }
.edq .hero p { margin-top: 10px; max-width: 34em; opacity: .9; font-size: 15px; }
.edq .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 22px; border-radius: 14px; font-weight: 800; letter-spacing: .02em; transition: transform .12s, box-shadow .12s, background .12s; }
.edq .btn:active { transform: translateY(2px) scale(.99); }
.edq .btn-jaune { background: var(--jaune); color: var(--nuit); box-shadow: 0 4px 0 #c99a00; }
.edq .btn-jaune:active { box-shadow: 0 1px 0 #c99a00; }
.edq .btn-bleu { background: var(--bleu); color: #fff; box-shadow: 0 4px 0 #083fb0; }
.edq .btn-bleu:active { box-shadow: 0 1px 0 #083fb0; }
.edq .btn-contour { background: var(--carte); color: var(--nuit); box-shadow: inset 0 0 0 2px var(--trait); }
.edq .btn-danger { color: var(--rouge); box-shadow: inset 0 0 0 2px var(--rouge-clair); background: var(--carte); }
.edq .btn-large { width: 100%; font-size: 17px; min-height: 56px; }
.edq .hero .btn { margin-top: 20px; }

.edq .joueur { display: flex; align-items: center; gap: 14px; }
.edq .medaille { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--bleu-clair); color: var(--bleu); font-weight: 800; font-size: 22px; }
.edq .joueur h2 { font-size: 17px; font-weight: 800; }
.edq .joueur .lien { color: var(--bleu); font-size: 13px; font-weight: 600; text-decoration: underline; padding: 6px 0; }
.edq .barre { height: 10px; border-radius: 999px; background: var(--bleu-clair); overflow: hidden; margin-top: 8px; }
.edq .barre > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--bleu), #4d8dff); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.edq .barre.jaune { background: var(--jaune-clair); }
.edq .barre.jaune > span { background: var(--jaune); }
.edq .barre.verte > span { background: var(--vert); }

.edq .tuiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.edq .tuile { background: var(--carte); border-radius: 16px; box-shadow: var(--ombre); padding: 14px 16px; }
.edq .tuile b { display: block; font-size: 24px; font-weight: 800; color: var(--nuit); font-variant-numeric: tabular-nums; line-height: 1.2; }
.edq .tuile span { font-size: 13px; color: var(--doux); }

.edq .quotidien { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--jaune-clair); border: 2px dashed var(--jaune); border-radius: var(--rayon); padding: 16px; margin-bottom: 16px; }
.edq .quotidien .ico { font-size: 30px; }
.edq .quotidien b { display: block; font-size: 16px; }
.edq .quotidien span { font-size: 13px; color: var(--doux); }
.edq .quotidien.fait { background: var(--vert-clair); border-color: var(--vert); border-style: solid; }

/* ───────── Listes de modes et de thèmes ───────── */
.edq .liste { display: grid; gap: 10px; }
.edq .ligne { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--carte); border-radius: 16px; box-shadow: var(--ombre); padding: 14px 16px; min-height: 68px; transition: transform .12s; }
.edq .ligne:active { transform: scale(.985); }
.edq .ligne .ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bleu-clair); font-size: 22px; }
.edq .ligne .txt { flex: 1; min-width: 0; }
.edq .ligne b { display: block; font-size: 15.5px; }
.edq .ligne .txt span { font-size: 13px; color: var(--doux); }
.edq .ligne .fleche { color: var(--doux); font-size: 20px; }
.edq .ligne.vedette .ico { background: var(--jaune); }
.edq .ligne .pc { flex: none; font-weight: 800; font-size: 14px; color: var(--bleu); font-variant-numeric: tabular-nums; }
/* Séries numérotées et séries réussies (80 % ou plus) */
.edq .ligne .num { font-size: 18px; font-weight: 800; color: var(--bleu); }
.edq .ligne.reussie .ico { background: var(--vert-clair); }
.edq .ligne.reussie .num, .edq .ligne.reussie .pc { color: var(--vert); }
@media (min-width: 640px) {
  .edq .liste.deux { grid-template-columns: 1fr 1fr; }
  .edq .tuiles { grid-template-columns: repeat(4, 1fr); }
}

/* ───────── Partie en cours ───────── */
.edq .jeu-haut { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; position: relative; }
.edq .quitter { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--carte); box-shadow: var(--ombre); font-size: 18px; color: var(--doux); }
.edq .jeu-haut .barre { flex: 1; margin: 0; height: 12px; }
.edq .compteur { font-weight: 800; font-size: 14px; color: var(--doux); font-variant-numeric: tabular-nums; }
.edq .jeu-infos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; font-weight: 700; }
.edq .pastille { padding: 5px 10px; border-radius: 999px; background: var(--bleu-clair); color: var(--bleu); }
.edq .pastille.jaune { background: var(--jaune-clair); color: #8a6a00; }
.edq .pastille.nuit { background: var(--nuit); color: #fff; }
.edq .jeu-infos .score { margin-left: auto; color: var(--nuit); font-variant-numeric: tabular-nums; }
.edq .xp-vol { position: absolute; right: 0; top: 34px; font-weight: 800; color: #b58900; pointer-events: none; animation: edq-vol 1s ease-out forwards; }
@keyframes edq-vol { from { opacity: 0; transform: translateY(8px); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-26px); } }

.edq .chrono { height: 8px; border-radius: 999px; background: var(--trait); overflow: hidden; margin-bottom: 12px; }
.edq .chrono > span { display: block; height: 100%; width: 100%; background: var(--jaune); border-radius: 999px; transform-origin: left; }
.edq .chrono.urgent > span { background: var(--rouge); }

.edq .question h2 { font-size: clamp(18px, 4.6vw, 22px); line-height: 1.3; font-weight: 800; color: var(--nuit); text-wrap: pretty; }
.edq .situation-bandeau { display: inline-block; margin-bottom: 10px; padding: 4px 10px; border-radius: 8px; background: var(--nuit); color: var(--jaune); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.edq .illu { margin: 14px 0 0; padding: 10px; background: var(--fond); border-radius: 12px; }
.edq .illu svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.edq .reponses { display: grid; gap: 10px; margin-top: 16px; }
.edq .rep { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; min-height: 58px; border-radius: 14px; background: var(--carte); box-shadow: inset 0 0 0 2px var(--trait); font-weight: 600; transition: transform .12s, box-shadow .15s, background .15s, opacity .2s; }
.edq .rep .lettre { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--fond); color: var(--doux); font-weight: 800; font-size: 14px; }
.edq .rep:not(:disabled):active { transform: scale(.985); }
@media (hover: hover) { .edq .rep:not(:disabled):hover { box-shadow: inset 0 0 0 2px var(--bleu); } }
.edq .rep:disabled { cursor: default; }
.edq .rep.choisie { box-shadow: inset 0 0 0 2px var(--bleu); background: var(--bleu-clair); }
.edq .rep.juste { background: var(--vert-clair); box-shadow: inset 0 0 0 2px var(--vert); animation: edq-juste .45s ease; }
.edq .rep.juste .lettre { background: var(--vert); color: #fff; }
.edq .rep.fausse { background: var(--rouge-clair); box-shadow: inset 0 0 0 2px var(--rouge); animation: edq-fausse .4s ease; }
.edq .rep.fausse .lettre { background: var(--rouge); color: #fff; }
.edq .rep.retiree { opacity: .3; text-decoration: line-through; }
@keyframes edq-juste { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes edq-fausse { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

.edq .jokers { display: flex; gap: 8px; margin-top: 14px; }
.edq .joker { flex: 1; min-height: 46px; padding: 6px; border-radius: 12px; background: var(--jaune-clair); color: #6b5200; font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 2px #ffe07a; }
.edq .joker:disabled { opacity: .4; cursor: default; }
.edq .joker.arme { background: var(--jaune); }
.edq .indice { margin-top: 12px; padding: 10px 12px; border-left: 4px solid var(--jaune); background: var(--jaune-clair); border-radius: 0 10px 10px 0; font-size: 14px; }

.edq .retour { margin-top: 16px; padding: 16px; border-radius: 14px; animation: edq-entree .3s ease; }
.edq .retour.ok { background: var(--vert-clair); }
.edq .retour.ko { background: var(--rouge-clair); }
.edq .retour h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.edq .retour.ok h3 { color: #0a6b3c; }
.edq .retour.ko h3 { color: #a51d1d; }
.edq .retour p { font-size: 15px; }
.edq .retour .ref { margin-top: 8px; font-size: 12.5px; color: var(--doux); }
.edq .retour .btn { margin-top: 14px; }

/* ───────── Résultats ───────── */
.edq .resultat { text-align: center; }
.edq .anneau { --p: 0; width: 150px; height: 150px; margin: 4px auto 14px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--bleu) calc(var(--p) * 1%), var(--bleu-clair) 0); }
.edq .anneau div { width: 118px; height: 118px; border-radius: 50%; background: var(--carte); display: grid; place-content: center; }
.edq .anneau b { font-size: 34px; font-weight: 800; color: var(--nuit); line-height: 1; }
.edq .anneau span { font-size: 12px; color: var(--doux); }
.edq .resultat h1 { font-size: 24px; font-weight: 800; color: var(--nuit); text-wrap: balance; }
.edq .resultat .msg { color: var(--doux); margin-top: 6px; }
.edq .record { display: inline-block; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: var(--jaune); color: var(--nuit); font-weight: 800; font-size: 13px; }
.edq .gains { display: grid; gap: 6px; text-align: left; font-size: 14.5px; }
.edq .gains div { display: flex; justify-content: space-between; gap: 12px; }
.edq .gains b { font-variant-numeric: tabular-nums; }
.edq .gains .total { border-top: 1px solid var(--trait); padding-top: 8px; margin-top: 4px; font-size: 16px; font-weight: 800; }
.edq .actions { display: grid; gap: 10px; }
.edq .correction { text-align: left; padding: 14px 0; border-top: 1px solid var(--trait); }
.edq .correction:first-child { border-top: 0; padding-top: 0; }
.edq .correction h3 { font-size: 15px; font-weight: 700; }
.edq .correction p { font-size: 14px; margin-top: 4px; }
.edq .correction .v { color: #0a6b3c; font-weight: 700; }
.edq .correction .x { color: #a51d1d; }

/* ───────── Statistiques et badges ───────── */
.edq .progres { margin-bottom: 14px; }
.edq .progres:last-child { margin-bottom: 0; }
.edq .progres .tete { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.edq .progres .tete span:last-child { color: var(--doux); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.edq .progres.sous { margin: 10px 0 0 22px; }
.edq .progres.sous .tete { font-size: 13px; font-weight: 500; color: var(--doux); }
.edq .progres.sous .barre { height: 6px; }
.edq .lien-retour { color: var(--bleu); font-weight: 700; font-size: 14px; padding: 8px 0; min-height: 40px; }
.edq .ratee { padding: 10px 0; border-top: 1px solid var(--trait); font-size: 14px; }
.edq .ratee:first-of-type { border-top: 0; }
.edq .ratee small { display: block; color: var(--rouge); font-weight: 700; }
.edq .badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .edq .badges { grid-template-columns: repeat(3, 1fr); } }
.edq .badge { background: var(--carte); border-radius: 16px; box-shadow: var(--ombre); padding: 16px 12px; text-align: center; }
.edq .badge .ico { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 8px; border-radius: 50%; background: var(--jaune); font-size: 28px; }
.edq .badge b { display: block; font-size: 14px; line-height: 1.25; }
.edq .badge span { display: block; font-size: 12.5px; color: var(--doux); margin-top: 4px; }
.edq .badge.verrou { box-shadow: inset 0 0 0 2px var(--trait); background: transparent; }
.edq .badge.verrou .ico { background: var(--trait); filter: grayscale(1); opacity: .55; }
.edq .badge.verrou b { color: var(--doux); }

/* ───────── Fenêtre modale et notifications ───────── */
.edq .voile { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(10, 31, 68, .55); animation: edq-fondu .2s; }
@keyframes edq-fondu { from { opacity: 0; } to { opacity: 1; } }
.edq .modale { width: 100%; max-width: 400px; background: var(--carte); border-radius: 20px; padding: 22px; animation: edq-entree .25s; }
.edq .modale h2 { font-size: 19px; font-weight: 800; color: var(--nuit); }
.edq .modale p { margin-top: 8px; color: var(--doux); font-size: 15px; }
.edq .modale input { width: 100%; margin-top: 14px; padding: 12px 14px; font: inherit; border-radius: 12px; border: 2px solid var(--trait); color: var(--texte); background: #fff; }
.edq .modale .actions { margin-top: 16px; }
.edq .toasts { position: fixed; left: 0; right: 0; bottom: 18px; z-index: 60; display: grid; gap: 8px; justify-items: center; padding: 0 16px; pointer-events: none; }
.edq .toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 12px 16px; border-radius: 14px; background: var(--nuit); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(10, 31, 68, .3); animation: edq-toast 3.6s forwards; }
.edq .toast i { font-style: normal; font-size: 22px; }
@keyframes edq-toast { 0% { opacity: 0; transform: translateY(16px); } 8%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  .edq *, .edq *::before, .edq *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
