/* Exercices et examen : blanc, marine et jaune comme Théorie. Vert et rouge : correction seulement. */
:root { --mist: #f1f4f9; --line: #c3cde0; --good: #0f7a4d; --good-2: #e3f5ec; --bad: #c22f2f; --bad-2: #fdebea; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main h1:focus { outline: 0; }
.q-credits { padding-block: 2rem 1rem; color: var(--ink-2); font-size: .9rem; }
.q-credits summary { width: fit-content; text-decoration: underline; cursor: pointer; }
.q-credits ul { columns: 3 18rem; margin-top: .75rem; }
.q-credits li { break-inside: avoid; overflow-wrap: anywhere; }

/* Choix de l'exercice */
.q-home { padding-block: clamp(1.75rem, 3.5vw, 3rem) clamp(3rem, 6vw, 5rem); }
.q-home h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.q-home h1 + p { margin-top: .75rem; font-size: 1.25rem; }
.q-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(14rem, 23vw, 20rem); gap: 1rem; margin-top: 2rem; }
.q-cards li:first-child { grid-column: span 2; }
.q-cards a { position: relative; display: block; height: 100%; overflow: hidden; border-radius: 1.1rem; background: var(--ink); color: #fff; text-decoration: none; }
.q-cards img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.q-cards a:hover img { transform: scale(1.06); }
.q-cards a::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 25%, rgb(10 18 48 / .8) 68%, rgb(10 18 48 / .96)); }
.q-cards div { position: absolute; left: 1.4rem; right: 1.4rem; bottom: 1.2rem; z-index: 1; }
.q-cards h2 { font-size: clamp(1.5rem, 2.5vw, 2.1rem); }
.q-cards p { margin-top: .3rem; color: #d5def0; }
.q-note { position: absolute; right: 1rem; top: 1rem; z-index: 1; padding: .4rem .9rem; border-radius: 99px; background: var(--yellow); color: var(--ink); font-weight: 800; line-height: 1.3; }

/* Arrivée sur l'examen */
.q-exam { position: relative; display: grid; align-items: center; min-height: min(44rem, calc(100vh - 5rem)); overflow: hidden; background: #0a1230 url(../photos/processeur.jpg) center / cover; color: #fff; }
.q-exam::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(10 18 48 / .93) 25%, rgb(10 18 48 / .45) 75%, rgb(10 18 48 / .2)); }
.q-exam .wrap { position: relative; padding-block: 4rem; }
.q-exam h1 { max-width: 12ch; font-size: clamp(3rem, 7.5vw, 6.5rem); }
.q-facts { display: flex; flex-wrap: wrap; gap: 1.25rem clamp(2rem, 4vw, 3.5rem); margin: 2rem 0 2.5rem; }
.q-facts li { font-size: 1.1rem; line-height: 1.3; }
.q-facts b { display: block; color: var(--yellow); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.1; letter-spacing: -.02em; }
.q-exam .btn { background: var(--yellow); color: var(--ink); }
.q-exam .btn:hover { background: #fff; }
.q-exam .btn--line { background: transparent; color: #fff; box-shadow: inset 0 0 0 3px #fff; }
.q-exam .btn--line:hover { background: #fff; color: var(--ink); }
.q-exam .q-best { margin-top: 1.5rem; font-weight: 600; }
.q-exam :focus-visible { outline-color: var(--yellow); }

/* Une question */
.q-run { display: flex; flex-direction: column; gap: clamp(1.1rem, 2.2vw, 1.75rem); min-height: calc(100vh - 5rem); padding-block: 1.25rem 0; }
.q-run h1 { max-width: 26ch; font-size: clamp(1.75rem, 3.6vw, 3rem); line-height: 1.1; }
.q-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; font-weight: 600; }
.q-back::before { content: "← "; }
.q-steps { flex: 1 1 14rem; display: flex; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.q-steps li { flex: 1; height: .7rem; border-radius: 99px; background: #dfe5f0; }
.q-steps .is-now { background: var(--ink); }
.q-steps .is-good { background: var(--good); }
.q-steps .is-half { background: linear-gradient(90deg, var(--good) 50%, #dfe5f0 50%); }
.q-steps .is-bad { background: var(--bad); }
.q-area { flex: 1; }

.q-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.q-opts button { position: relative; display: flex; align-items: center; gap: 1.1rem; min-height: 5.25rem; padding: 1rem 1.25rem; border: 0; border-radius: 1rem; background: var(--mist); box-shadow: inset 0 0 0 2px var(--line); color: var(--ink); font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-weight: 600; line-height: 1.25; text-align: left; cursor: pointer; transition: background-color .15s, box-shadow .15s; }
.q-opts button:hover:enabled { background: #fff; box-shadow: inset 0 0 0 3px var(--ink); }
.q-opts i { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #fff; font-style: normal; font-weight: 800; }
.q-opts span { flex: 1; overflow-wrap: anywhere; }
.q-opts button[aria-pressed="true"]:enabled { background: #fff3cd; box-shadow: inset 0 0 0 4px var(--yellow); }
.q-opts button[aria-pressed="true"]:enabled i { background: var(--yellow); }
.q-opts button:disabled { cursor: default; }
.q-opts--vf i { display: none; }
.q-opts--vf button { justify-content: center; text-align: center; min-height: clamp(8rem, 16vw, 14rem); font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 800; }
.q-opts--vf span { flex: none; }
.q-opts .is-good { background: var(--good-2); box-shadow: inset 0 0 0 3px var(--good); }
.q-opts .is-bad { background: var(--bad-2); box-shadow: inset 0 0 0 3px var(--bad); }
.q-opts .is-good i { background: var(--good); color: #fff; }
.q-opts .is-bad i { background: var(--bad); color: #fff; }
.q-opts em, .q-match em { font-size: 1rem; font-style: normal; font-weight: 600; }
.is-good > em { color: var(--good); }
.is-bad > em { color: var(--bad); }
.q-opts .is-off { color: var(--ink-2); }
.q-opts--pics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.q-opts--pics button { display: block; padding: .9rem; background: #fff; overflow: hidden; }
.q-opts--pics img { width: 100%; height: clamp(9rem, 22vw, 20rem); object-fit: contain; }
.q-opts--pics .is-off img { opacity: .45; }
.q-opts--pics em { display: block; margin-top: .5rem; text-align: center; }
.q-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1rem, 3vw, 2.5rem); align-items: center; }
.q-split .q-opts { grid-template-columns: minmax(0, 1fr); }
.q-photo { display: grid; place-items: center; overflow: hidden; border-radius: 1.1rem; background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.q-photo img { width: 100%; max-height: min(50vh, 27rem); padding: 1rem; object-fit: contain; }

.q-scene { overflow: hidden; border-radius: 1.1rem; background: #11151c; }
.q-scene svg { display: block; width: 100%; max-height: max(24rem, calc(100vh - 21rem)); margin-inline: auto; }
.q-scene g { outline: 0; }
.q-scene g[tabindex] { cursor: pointer; }
.q-scene .zone { fill: transparent; stroke: rgb(255 255 255 / .6); stroke-width: 3; }
.q-scene .dot { fill: #fff; stroke: var(--ink); stroke-width: 7; }
.q-scene g[tabindex]:hover .zone, .q-scene g:focus-visible .zone { fill: rgb(255 199 44 / .25); stroke: var(--yellow); stroke-width: 6; }
.q-scene g[tabindex]:hover .dot, .q-scene g:focus-visible .dot, .q-scene .is-on .dot { fill: var(--yellow); }
.q-scene .is-on .zone { fill: rgb(255 199 44 / .3); stroke: var(--yellow); stroke-width: 10; }
.q-scene .num { fill: #fff; font: 800 40px var(--font); text-anchor: middle; dominant-baseline: central; }
.q-scene .is-good .zone { fill: rgb(15 122 77 / .35); stroke: #34d08b; stroke-width: 11; }
.q-scene .is-bad .zone { fill: rgb(194 47 47 / .35); stroke: #ff6b6b; stroke-width: 11; }
.q-scene .is-good .dot { r: 36px; fill: var(--good); stroke: #fff; stroke-width: 5; }
.q-scene .is-bad .dot { r: 36px; fill: var(--bad); stroke: #fff; stroke-width: 5; }
.q-scene .is-off { display: none; }

.q-match { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(1rem, 4vw, 3.5rem); align-items: start; }
.q-match ul { display: grid; gap: .75rem; }
.q-match li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; gap: .5rem 1rem; }
.q-match li b { font-size: 1.2rem; line-height: 1.25; overflow-wrap: anywhere; }
.q-match li button { min-height: 4rem; padding: .7rem 1rem; border: 0; border-radius: .9rem; background: #fff3cd; box-shadow: inset 0 0 0 3px var(--yellow); color: var(--ink); font-weight: 600; line-height: 1.25; cursor: pointer; overflow-wrap: anywhere; }
.q-match li .is-empty { background: var(--mist); box-shadow: none; outline: 2px dashed #8794b1; outline-offset: -2px; color: var(--ink-2); font-weight: 400; }
.q-match li .is-now { outline: 3px solid var(--ink); outline-offset: -3px; }
.q-match li button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.q-match em { grid-column: 2; }
.q-match .is-good button { background: var(--good-2); box-shadow: inset 0 0 0 3px var(--good); outline: 0; }
.q-match .is-bad button { background: var(--bad-2); box-shadow: inset 0 0 0 3px var(--bad); outline: 0; color: var(--ink); }
.q-match:not(:has(.q-chips)) { grid-template-columns: minmax(0, 46rem); }
.q-chips { display: grid; gap: .75rem; }
.q-chips button { min-height: 4rem; padding: .7rem 1.25rem; border: 0; border-radius: 99px; background: var(--ink); color: #fff; font-weight: 600; line-height: 1.25; cursor: pointer; }
.q-chips button:hover:enabled { background: var(--yellow); color: var(--ink); }
.q-chips button:disabled { background: var(--mist); color: #b3bed3; cursor: default; }

.q-foot { --fb: #f1f4f9; position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-block: 1rem; background: var(--fb); border-image: linear-gradient(var(--fb), var(--fb)) fill 0 / / 0 100vw; }
.q-foot:empty { display: none; }
.q-foot > div[role="status"] { flex: 1 1 20rem; line-height: 1.4; }
.q-foot strong { font-size: 1.4rem; }
.q-foot.is-good { --fb: #e3f5ec; }
.q-foot.is-bad { --fb: #fdebea; }
.q-foot.is-good strong { color: var(--good); }
.q-foot.is-bad strong { color: var(--bad); }
.q-foot .btn:disabled { opacity: .45; cursor: not-allowed; }

/* Examen */
.q-clock { margin-left: auto !important; padding: .35rem 1.1rem; border-radius: 99px; background: var(--ink); color: #fff; }
.q-clock b { font-variant-numeric: tabular-nums; font-size: 1.25rem; }
.q-clock.is-late { background: var(--bad); }
.q-theme { color: var(--ink-2); }
.q-map { display: grid; grid-template-columns: repeat(25, minmax(0, 1fr)); gap: .35rem; }
.q-map button { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: .6rem; background: var(--mist); box-shadow: inset 0 0 0 2px var(--line); color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; }
.q-map button:hover { box-shadow: inset 0 0 0 3px var(--ink); }
.q-map .is-done { background: var(--yellow); box-shadow: none; }
.q-map [aria-current] { background: var(--ink); box-shadow: none; color: #fff; }
.q-map .is-done[aria-current] { box-shadow: inset 0 -.4rem 0 var(--yellow); }
.q-dialog { width: min(32rem, calc(100vw - 40px)); padding: clamp(1.5rem, 4vw, 2.5rem); border: 0; border-radius: 1.1rem; color: var(--ink); }
.q-dialog::backdrop { background: rgb(10 18 48 / .7); }
.q-dialog h2 { font-size: 2rem; }
.q-dialog p { margin: .9rem 0 1.5rem; }

/* Résultat */
.q-result { background: var(--yellow); }
.q-result.is-fail { background: var(--mist); }
.q-result .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 2rem clamp(2rem, 6vw, 6rem); padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.q-result .wrap > div:last-child { flex: 1 1 22rem; display: grid; gap: 1rem; }
.q-result h1 { font-size: clamp(3rem, 7vw, 5.5rem); }
.q-result p { font-size: 1.2rem; }
.q-result .q-kind { font-weight: 600; }
.q-ring { position: relative; flex: none; width: clamp(14rem, 26vw, 20rem); aspect-ratio: 1; border-radius: 50%; background: var(--ink); color: #fff; }
.q-ring svg { display: block; width: 100%; transform: rotate(-90deg); }
.q-ring circle { fill: none; stroke: rgb(255 255 255 / .16); stroke-width: 9; }
.q-ring .fg { stroke: var(--yellow); stroke-linecap: round; animation: q-ring 1.2s cubic-bezier(.2, .8, .2, 1); }
@keyframes q-ring { from { stroke-dashoffset: var(--c); } }
.q-ring p { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; line-height: 1; align-content: center; flex-wrap: wrap; }
.q-ring b { font-size: clamp(4.5rem, 9vw, 7rem); font-weight: 800; letter-spacing: -.05em; }
.q-ring span { font-size: 1.4rem; font-weight: 600; }
.q-parts, .q-review { padding-top: clamp(2rem, 4vw, 3.5rem); }
.q-parts h2, .q-review h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.q-bars { display: grid; gap: .9rem; margin-top: 1.25rem; }
.q-bars li { display: grid; grid-template-columns: 10rem minmax(0, 1fr) 4.5rem; align-items: center; gap: 1rem; }
.q-bars a { font-weight: 600; }
.q-bar { height: 1.1rem; overflow: hidden; border-radius: 99px; background: #dfe5f0; }
.q-bar i { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.q-bars b { text-align: right; }
.q-review { padding-bottom: 1rem; }
.q-review > div { display: grid; gap: .6rem; margin-top: 1.25rem; }
.q-review details { border-radius: .9rem; background: var(--mist); }
.q-review summary { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; font-weight: 600; line-height: 1.3; cursor: pointer; list-style: none; }
.q-review summary::-webkit-details-marker { display: none; }
.q-review summary::after { content: ""; flex: none; width: .6rem; height: .6rem; margin: 0 .4rem 0 auto; border: solid var(--ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.q-review [open] summary::after { transform: rotate(225deg); }
.q-review summary b { flex: none; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--bad); color: #fff; }
.q-review summary em { flex: none; color: var(--bad); font-style: normal; }
.q-review details > div { display: grid; gap: 1rem; padding: .25rem 1.1rem 1.4rem; }
.q-review .q-scene { justify-self: start; width: min(100%, 46rem); }
.q-review .q-opts button:not(.is-good, .is-bad) { background: #fff; }
.q-review .q-opts button { min-height: 4rem; }
.q-end { padding-block: 1rem 2.5rem; font-weight: 600; }

@media (max-width: 62rem) {
  .q-map { grid-template-columns: repeat(13, minmax(0, 1fr)); }
  .q-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(12rem, 34vw, 17rem); }
}
@media (max-width: 48rem) {
  .q-opts, .q-split, .q-match { grid-template-columns: minmax(0, 1fr); }
  .q-opts--pics, .q-opts--vf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-opts button { min-height: 4.25rem; }
  .q-photo img { max-height: 15rem; }
  .q-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
  .q-chips button { min-height: 3.25rem; padding: .6rem 1rem; }
  .q-scene { margin-inline: -20px; border-radius: 0; }
  .q-scene .dot { r: 38px; }
  .q-result .wrap { justify-content: center; }
  .q-bars li { grid-template-columns: minmax(0, 1fr) 4rem; gap: .25rem 1rem; }
  .q-bar { grid-column: 1 / -1; grid-row: 2; }
  .q-foot .btn { padding: .9rem 1.2rem; }
}
@media (max-width: 36rem) {
  .q-map { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .q-cards { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 12.5rem; }
  .q-cards li:first-child { grid-column: auto; }
  .q-match li { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .q-match em { grid-column: 1; }
  .q-exam::before { background: rgb(10 18 48 / .78); }
}
@media (prefers-reduced-motion: reduce) { .q-ring .fg { animation: none; } }

/* Parcours : thèmes et examen fermés */
.q-padlock { position: absolute; left: 1rem; top: 1rem; z-index: 1; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: #fff; }
.q-padlock svg, .q-lock svg { width: 1.6rem; fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.q-cards .is-locked img { filter: grayscale(1) brightness(.75); }
.q-locked { display: grid; gap: 1.4rem; align-content: center; justify-items: start; min-height: calc(100vh - 12rem); padding-block: 3rem; }
.q-locked h1 { max-width: 18ch; font-size: clamp(2.2rem, 5vw, 4rem); }
.q-locked p { font-size: 1.2rem; }
.q-lock { display: grid; place-items: center; width: 6rem; height: 6rem; border-radius: 50%; background: var(--yellow); }
.q-lock svg { width: 3rem; }
.q-gate { max-width: 46rem; margin-bottom: 2rem; }
.q-gate p { font-size: 1.25rem; font-weight: 600; }
.q-gate ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: .6rem; margin-top: 1rem; }
.q-gate li { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1.1rem; border-radius: .8rem; background: rgb(255 255 255 / .13); }
.q-gate .is-ok { background: var(--yellow); color: var(--ink); }
.q-gate a { font-weight: 600; }
