/* Blocs de l'accueil (essai local web-v2, lot 1). Chargé après style.css. */

.homex { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.hx { padding: 16px; display: grid; gap: 10px; align-content: start; text-align: left; }
.hx:empty { display: none; }
.hx .hxh { display: flex; align-items: center; gap: 8px; }
.hx .hxh > svg { width: 20px; height: 20px; }
.hx h2 { margin: 0; font-size: 19px; font-weight: 800; }
.hx .hxs { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.35; }

/* ---- ta semaine ---- */
.wkst { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; color: var(--muted); padding: 5px 10px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.wkst b { font-size: 15px; color: var(--ink); }
.wkst.on { background: #FFE9D6; color: #C2410C; } .wkst.on b { color: #C2410C; }
.wkst.lock { color: var(--hl); background: var(--hl-soft); }
.wkst svg { width: 15px; height: 15px; }
:root[data-theme="dark"] .wkst.on { background: #40261A; color: #FFA36B; } :root[data-theme="dark"] .wkst.on b { color: #FFA36B; }
.wkrow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 4px 0 2px; }
.wk { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 5px; }
.wk i { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--soft); color: var(--muted); font-size: 15px; }
.wk i b { font-weight: 800; } .wk i svg { width: 16px; height: 16px; stroke-width: 3; }
.wk small { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.wk.on i { background: var(--ok); color: #fff; }
.wk.now i { background: transparent; box-shadow: inset 0 0 0 2.5px var(--coral, #F0836A); animation: wkpulse 1.8s ease-in-out infinite; }
.wk.now small { color: var(--ink); }
.wk.fut i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
@keyframes wkpulse { 50% { box-shadow: inset 0 0 0 2.5px var(--coral, #F0836A), 0 0 0 5px color-mix(in srgb, var(--coral, #F0836A) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .wk.now i { animation: none; } }
html.calm .wk.now i { animation: none; }

.wkstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.wkstats span { display: grid; gap: 1px; padding: 8px 6px; border-radius: 14px; background: var(--soft); text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.2; }
.wkstats b { font-size: 18px; font-weight: 800; color: var(--ink); }

/* ---- progression du jour, sur les puces de quiz ---- */
.modes2 h2 .qcount { margin-left: 8px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); vertical-align: 2px; }
.modes2 h2 .qcount.full { background: var(--ok-bg); color: var(--ok); }
.modes2 .mode .mdone { font-style: normal; font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--ok); color: #fff; margin-left: 2px; }

/* ---- le piège d'hier ---- */
.trappct { font-size: 15px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); }
.trapq { margin: 2px 0; font-size: 18px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; padding-left: 12px; border-left: 4px solid var(--coral, #F0836A); }
.trapq.struck { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 70%, transparent); }
.trapbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tb { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; border-radius: 999px; font-weight: 800; font-size: 15px; color: #fff; }
.tb.ok { background: var(--ok); } .tb.bad { background: var(--bad); }
.tb:active { transform: scale(.97); }
.trapres { padding: 9px 12px; border-radius: 14px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.trapres.ok { background: var(--ok-bg); color: var(--ok); } .trapres.bad { background: var(--bad-bg); color: var(--bad); }
.trapwhy { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); font-weight: 500; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.trapwhy a { color: var(--hl); font-weight: 800; }

/* ---- ton profil de joueur ---- */
.skrows { display: grid; gap: 9px; }
.sk { display: grid; grid-template-columns: minmax(0, 134px) minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 800; }
.sk .skn { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sk .skn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk .skn svg { width: 16px; height: 16px; color: var(--c); flex: none; }
.sk .skbar { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.sk .skbar i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.sk .skp { text-align: right; font-size: 13.5px; }
.sk.weak .skp { color: var(--bad); }
.skill.ghost .skbar i { opacity: .28; }
.hxbtn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 11px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; background: var(--hl-soft); color: var(--hl); }
.hxbtn span { white-space: pre; }
.hxbtn:active { transform: scale(.98); }

/* ---- ordinateur : une rangée de trois cartes sous les deux colonnes ---- */
@media (min-width: 980px) {
  :root .stack.home > .homex { grid-column: 1 / -1; grid-row: 3; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 24px; align-items: stretch; }
  .hx { padding: 18px 20px; }
}

/* ---- série : gros chiffre, objectif suivant ---- */
.stk { display: flex; align-items: center; gap: 12px; }
.stkn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px 8px 10px; border-radius: 18px; background: var(--soft); color: var(--muted); flex: none; }
.stkn svg { width: 26px; height: 26px; } .stkn b { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.stk.on .stkn { background: #FFE9D6; color: #C2410C; }
:root[data-theme="dark"] .stk.on .stkn { background: #40261A; color: #FFA36B; }
.stkt { display: grid; gap: 2px; min-width: 0; } .stkt > b { font-size: 16px; font-weight: 800; }
.goal { display: grid; gap: 6px; }
.goalh { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 800; color: var(--muted); }
.goalh b { color: var(--ink); }
.goal .skbar { display: block; height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.goal .skbar i { display: block; height: 100%; border-radius: 99px; background: var(--coral, #F0836A); }

/* ---- points forts : étiquette « Exemple », deux chiffres, phrase de synthèse ---- */
.extag { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.skbody { display: grid; gap: 10px; }
.skill.ghost .skbody { opacity: .5; filter: saturate(.6); }
.skill.ghost .skbar i { opacity: 1; }
.skduo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skduo span { display: grid; gap: 1px; padding: 8px 6px; border-radius: 14px; background: var(--soft); text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.2; }
.skduo b { font-size: 18px; font-weight: 800; color: var(--ink); }
.skline { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--muted); } .skline b { color: var(--ink); font-weight: 800; }

.trapt { width: 100%; text-align: left; cursor: default; }
.trapchev { display: none; }

/* ---- téléphone et tablette : l'accueil ne grossit pas. La semaine = une bande fine qui ouvre une fenêtre
   (semaine complète + points forts) ; le piège d'hier, replié sur une ligne, passe sous « What to remember ». ---- */
.wkopen { display: none; }
@media (max-width: 979px) {
  .homex { display: contents; }
  .homex > .skill { display: none; }
  .homex > .trap { order: 5; }
  .stack.home > .copyright { order: 6; }
  .homex > .hx { padding: 10px 14px; gap: 8px; }
  .homex > .hxweek { display: flex; align-items: center; gap: 10px; cursor: pointer; }
  .homex > .hxweek > .hxh, .homex > .hxweek > .hxs, .homex > .hxweek .wkstats, .homex > .hxweek > .hxbtn, .homex > .hxweek .wk i em { display: none; }
  .homex > .hxweek .wkrow { flex: 1; padding: 0; gap: 4px; }
  .homex > .hxweek .wk { gap: 2px; } .homex > .hxweek .wk i { max-width: 26px; font-size: 12px; } .homex > .hxweek .wk i svg { width: 12px; height: 12px; }
  .homex > .hxweek .wk small { font-size: 9.5px; }
  .homex > .hxweek .wkopen { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--hl); }
  .homex > .hxweek .wkopen svg { width: 15px; height: 15px; stroke-width: 2.8; }
  .trap h2 { font-size: 16px; } .trap .hxh > svg { width: 18px; height: 18px; }
  .trapt { cursor: pointer; }
  .trapchev { display: block; width: 16px; height: 16px; color: var(--muted); transition: transform .15s; transform: rotate(90deg); }
  .trap.open .trapchev { transform: rotate(-90deg); }
  .trap:not(.open) > :not(.trapt) { display: none; }
  .trap .trappct { font-size: 13px; padding: 3px 9px; }
  .trapq { font-size: 16px; }
}

/* ---- fenêtre « Your progress » (ouverte depuis la bande, sur téléphone) : les deux cartes complètes ---- */
.hxsheet { display: grid; gap: 18px; }
.hxsheet .hx { border: 0; box-shadow: none; background: none; padding: 0; border-radius: 0; }
.hxsheet .hx + .hx { padding-top: 18px; border-top: 1.5px solid var(--line); }

/* ---- boutons de la carte du jour : moins épais, sur une seule ligne ---- */
.herorow .herobtn { padding: 13px 16px; font-size: 16px; white-space: nowrap; }
.herorow .herobtn.duelbtn { padding: 0 18px; font-size: 16px; }
.herorow .herobtn.duelbtn svg { width: 19px; height: 19px; }
@media (max-width: 699px) {
  .herorow { gap: 8px; }
  .herorow .herobtn { padding: 11px 12px; font-size: 15px; }
  .herorow .herobtn.duelbtn { padding: 0 13px; font-size: 15px; gap: 6px; }
  .herorow .herobtn.duelbtn svg { width: 17px; height: 17px; }
}
@media (max-width: 360px) { .herorow .herobtn, .herorow .herobtn.duelbtn { font-size: 13.5px; padding-left: 9px; padding-right: 9px; } }

.wkstats.two { grid-template-columns: 1fr 1fr; }

/* ---- ta semaine : score sur 5 dans chaque pastille, période, jours manqués ---- */
.wk i em { font-style: normal; font-size: .72em; opacity: .8; }
.wk i .dash { color: var(--muted); opacity: .7; }
.wk i { max-width: 46px; font-size: 14px; }
.wkrange { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.wkstats b em { font-style: normal; font-size: .65em; color: var(--muted); }
.wkok { display: flex; align-items: center; gap: 6px; color: var(--ok) !important; font-weight: 800 !important; }
.wkok svg { width: 15px; height: 15px; stroke-width: 3; }
@media (min-width: 980px) { .hxweek { align-content: space-between; } }

/* ---- carte du jour sur téléphone : moins haute (les boutons tiennent sur une ligne), même hauteur avant et après le quiz ---- */
@media (max-width: 389px) {
  .herocard:not(.fin) p { font-size: 14px; line-height: 1.35; max-width: calc(100% - 78px); }
  .herocard.th-scitech:not(.fin) h1 { font-size: 25px; }
}
@media (max-width: 349px) { .herocard, .herocard.fin { min-height: 316px; } }
@media (min-width: 350px) and (max-width: 479px) { .herocard, .herocard.fin { min-height: 292px; } }
@media (min-width: 480px) and (max-width: 699px) { .herocard, .herocard.fin { min-height: 302px; } }
/* « Science & tech » a le titre le plus long : un peu plus haut sur les petits écrans, pour rester identique avant/après */
@media (max-width: 349px) { .herocard.th-scitech, .herocard.th-scitech.fin { min-height: 344px; } }
@media (min-width: 350px) and (max-width: 374px) { .herocard.th-scitech, .herocard.th-scitech.fin { min-height: 304px; } }
/* boutons de la carte du jour sur petit écran : ils doivent tenir dans la carte, y compris en français */
.herorow .herobtn { min-width: 0; }
@media (max-width: 400px) {
  .herorow .herobtn, .herorow .herobtn.duelbtn { font-size: 14px; padding-left: 10px; padding-right: 10px; }
  .herorow .herobtn.duelbtn svg { display: none; }
}
@media (max-width: 349px) { .herorow .herobtn, .herorow .herobtn.duelbtn { white-space: normal; font-size: 13.5px; line-height: 1.15; padding-top: 8px; padding-bottom: 8px; } }
/* téléphone : titre, phrase et les deux cartes-icônes un peu plus bas, sans agrandir la carte (l'espace est repris sur le vide du milieu) */
@media (max-width: 699px) {
  .herocard:not(.fin) h1 { margin-top: 8px; }
  .herocard:not(.fin) .flip { margin-top: 8px; }
  .herocard:not(.fin) .grow { min-height: 0; }
}
