/* A short match-reading drill, isolated from the editable court and its projector. */
.quiz-invite {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 14px;
  margin: 9px 0; padding: 5px 13px; border: 1px solid #bdd1bb; border-left: 4px solid #53773a;
  border-radius: 8px; background: #edf4e5; color: #233e36;
}
.quiz-invite-copy { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px }
.quiz-invite-copy strong { font-size: .99rem }.quiz-invite-copy span { font-size: .83rem }
#quiz-open,#quiz-leave,.quiz-replay button,.quiz-feedback-foot button {
  display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px;
  border-radius: 6px; padding: 6px 12px; font-size: .86rem; font-weight: 680; line-height: 1.24;
}
#quiz-open,.tcp-quiz .quiz-primary { color: #fff; background: #19574f; border: 1px solid #19574f; text-decoration: none }
#quiz-open:hover,.tcp-quiz .quiz-primary:hover { background: #123f3c }
#quiz-leave { border: 1px solid #9ab6af; background: #153542; color: #fff }
#quiz-intro { color: #e4ecee; font-size: .85rem; line-height: 1.4 }
.tv-mode .quiz-invite,.tv-mode .tcp-quiz { display: none }
.tcp-quiz { max-width: 67rem; margin: 14px auto 0; color: var(--at-ink) }
.quiz-boardbar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0 0 10px; font-variant-numeric: tabular-nums }
#quiz-round { font-size: .92rem }#quiz-score { margin-left: auto; font-size: .86rem; font-weight: 650 }
#quiz-progress { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0 }
#quiz-progress li {
  width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #aebfb7;
  font-size: .75rem; font-weight: 680; line-height: 1; background: #fffefa; color: #4a5d57;
}
#quiz-progress [aria-current="step"] { outline: 2px solid #285e53; outline-offset: 1px }
#quiz-progress [data-result="good"] { color: white; background: #226354; border-color: #226354 }
#quiz-progress [data-result="miss"] { color: white; background: #954526; border-color: #954526 }
.quiz-play {
  display: grid; grid-template-columns: minmax(190px,.62fr) minmax(0,1.38fr); grid-template-areas: "map story" "map picks" "map feedback";
  grid-template-rows: auto auto 1fr; align-items: start; gap: 12px clamp(15px,2.4vw,32px); padding: clamp(14px,2vw,24px);
  border: 1px solid var(--at-line); border-radius: 12px; background: var(--at-paper);
}
.quiz-map {
  grid-area: map; display: grid; justify-items: center; align-content: center; min-width: 0; margin: 0;
  padding: 8px; border-radius: 8px; background: linear-gradient(160deg,#173e47,#102e3a); color: #ebf5f0;
}
#quiz-court { display: block; width: 100%; height: clamp(235px,39vh,334px) }
.quiz-map figcaption { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px 12px; width: 100%; font-size: .78rem; line-height: 1.35 }
.quiz-map figcaption span { display: inline-flex; align-items: center; gap: 5px }
.quiz-map i { width: .68em; height: .68em; flex: none; background: #fffdf2; border-radius: 50% }
.quiz-map .quiz-diamond { background: #f3c6ff; border-radius: 0; transform: rotate(45deg) }
#quiz-map-key { flex-basis: 100%; justify-content: center; color: #e3f796; font-weight: 650 }
#quiz-map-key::before { content: ''; width: 14px; border-top: 2px solid }
#quiz-map-key[data-kind="move"] { color: #a7efff }#quiz-map-key[data-kind="move"]::before { border-top-style: dashed }
#quiz-run-key { color: #f3c6ff }#quiz-run-key::before { content: ''; width: 12px; border-top: 2px solid }
#quiz-route { color: #e3f796 }#quiz-route[data-kind="move"] { color: #a7efff }
#quiz-line { fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round }
#quiz-route[data-kind="move"] #quiz-line { stroke-dasharray: 4 3 }
#quiz-zone { fill: currentColor; fill-opacity: .3; stroke: currentColor; stroke-width: 1.8 }
.quiz-story { grid-area: story; min-width: 0 }
.tcp-quiz .quiz-kicker { color: #35654f; font-size: .75rem; font-weight: 720; letter-spacing: .07em; text-transform: uppercase }
.tcp-quiz :is(.quiz-story,.quiz-summary) h2 { font-size: clamp(1.2rem,2.1vw,1.85rem); line-height: 1.12; color: #173a40; margin: 4px 0 7px; letter-spacing: -.025em }
#quiz-scene,.quiz-summary > p:not(.quiz-kicker) { font-size: .94rem; line-height: 1.48; max-width: 67ch; color: #364d50 }
.quiz-picks { grid-area: picks }.quiz-picks legend { padding: 0; margin-bottom: 7px; color: #193d3e; font-size: .98rem; font-weight: 680; line-height: 1.35 }
#quiz-options { display: grid; gap: 6px }
#quiz-options button {
  display: flex; align-items: center; gap: 9px; min-height: 47px; width: 100%; padding: 7px 10px; text-align: left;
  border: 1px solid #b5c6bf; border-radius: 7px; background: white; color: #213d40; font-weight: 560; line-height: 1.3;
}
.quiz-letter { flex: none; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border: 1px solid #c5d3c7; border-radius: 5px; background: #ecf1e9; font-size: .83rem; font-weight: 720 }
@media(hover:hover) { #quiz-options button:not(:disabled):hover { background: #f0f5e6; border-color: #4f7762 } }
#quiz-options button:disabled { cursor: default; opacity: 1 }
#quiz-options [data-result="good"] { background: #edf6ee; border-color: #3c7a61 }
#quiz-options [data-result="miss"] { background: #fff3e9; border-color: #b47350 }
.quiz-option-text small { display: block; margin-top: 3px; font-weight: 680; color: #236449; font-size: .77rem }
[data-result="miss"] .quiz-option-text small { color: #8a4628 }
.quiz-feedback { grid-area: feedback; padding: 12px 14px; border-left: 3px solid #31755c; border-radius: 5px; background: #eff5ed }
.quiz-feedback[data-result="miss"] { border-color: #a4613d; background: #fcf3e9 }
.quiz-feedback h3,.quiz-summary h3 { font-size: 1.06rem; color: #203d3d; line-height: 1.25 }
.quiz-feedback p,.quiz-summary details p { margin-top: 6px; font-size: .9rem; line-height: 1.45; color: #344b4b }
.quiz-feedback-foot,.quiz-replay { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin-top: 10px }
.quiz-feedback-foot a { display: inline-flex; align-items: center; min-height: 44px; color: #37594f; text-decoration: underline; text-underline-offset: .15em; font-size: .8rem }
.quiz-summary { padding: clamp(15px,2.5vw,32px); background: var(--at-paper); border: 1px solid var(--at-line); border-top: 4px solid #42816a; border-radius: 10px }
.quiz-replay { justify-content: flex-start; margin: 12px 0 20px }
#quiz-new { background: #fff; color: #254c43; border: 1px solid #829d8b }
#quiz-recap { padding: 0; margin: 10px 0 0; list-style: none }
#quiz-recap li { padding: 3px 0; border-top: 1px solid var(--at-line) }
#quiz-recap summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 44px; padding: 4px 0; list-style: none }
#quiz-recap summary::-webkit-details-marker { display: none }
.quiz-recap-index { font-size: .78rem; color: #4d6861 }
.quiz-recap-state { font-size: .77rem; color: #216548; font-weight: 650 }
[data-result="miss"] .quiz-recap-state { color: #93502e }
.quiz-recap-state::after { content: ' ▾' } details[open] .quiz-recap-state::after { content: ' ▴' }
#quiz-recap details[open] { padding-bottom: 9px }
.tcp-quiz :is(h2,h3)[tabindex="-1"]:focus-visible { outline: 2px solid #72896c; outline-offset: 3px; border-radius: 3px }
@media(max-width:740px) {
  #quiz-intro { grid-column: 1/-1; font-size: .81rem }
  .angles-intro #quiz-leave { grid-column: 2; grid-row: 1/3; align-self: center; padding: 6px 8px; font-size: .79rem }
  .quiz-invite { padding: 5px 8px; gap: 5px }
  .quiz-invite-copy { display: grid; gap: 1px; flex: 1 1 110px; line-height: 1.25 }
  #quiz-open { padding: 5px 9px; font-size: .8rem }
  .tcp-quiz { margin-top: 10px }
  .quiz-boardbar { gap: 5px 8px }#quiz-round,#quiz-score { font-size: .8rem }
  #quiz-progress { gap: 3px }#quiz-progress li { width: 17px; height: 17px; font-size: .67rem }
  .quiz-play { grid-template-columns: minmax(85px,.72fr) minmax(0,1.28fr); grid-template-rows: auto; grid-template-areas: "map story" "picks picks" "feedback feedback"; gap: 12px 9px; padding: 10px }
  .quiz-map { padding: 5px 3px 7px }
  #quiz-court { height: clamp(135px,21svh,172px) }
  .quiz-map figcaption { gap: 2px 6px; font-size: .7rem }
  .quiz-story { align-self: center }
  .tcp-quiz .quiz-story h2 { font-size: 1.14rem }
  #quiz-scene { font-size: .87rem; line-height: 1.4 }
  .quiz-feedback { padding: 10px }
  .quiz-feedback-foot button { order: -1 }
}
@media(max-width:350px) {
  .quiz-boardbar { column-gap: 5px }#quiz-progress { gap: 2px }
  .quiz-play { grid-template-columns: minmax(81px,.65fr) minmax(0,1.35fr) }
}

/* La série n'existe qu'après validation du niveau. Le sélecteur reste natif au clavier. */
.quiz-setup { padding: clamp(16px,2.4vw,30px); background: var(--at-paper); border: 1px solid var(--at-line); border-top: 4px solid #377563; border-radius: 12px }
.quiz-setup h2 { margin: 3px 0 6px; color: #173a40; font-size: clamp(1.35rem,2.3vw,1.9rem); line-height: 1.15; letter-spacing: -.025em }
.quiz-setup-intro,.quiz-setup-note { max-width: 66ch; color: #405955; line-height: 1.45 }
.quiz-level-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 16px 0 }
.quiz-tier { position: relative; display: grid; align-content: start; gap: 5px; padding: 14px; cursor: pointer; border: 1px solid #adbfaf; border-radius: 9px; background: #fff; color: #193e37 }
.quiz-tier input { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; margin: 0; accent-color: #20594d }
.quiz-tier strong { font-size: 1.05rem; line-height: 1.2 }
.quiz-tier-copy { max-width: 38ch; font-size: .86rem; line-height: 1.4; color: #405955 }
.quiz-bars { display: inline-flex; height: 20px; align-items: flex-end; gap: 3px; margin-bottom: 4px }
.quiz-bars i { width: 6px; height: 7px; background: #3c7263; border-radius: 2px 2px 0 0 }
.quiz-bars i:nth-child(2) { height: 12px }.quiz-bars i:nth-child(3) { height: 17px }
.quiz-tier:first-child i:not(:first-child),.quiz-tier:nth-child(2) i:last-child { background: #d3ded5 }
.quiz-tier:has(input:checked) { border-color: #32715d; box-shadow: inset 0 0 0 1px #32715d; background: #edf5e6 }
.quiz-tier:has(input:focus-visible) { outline: 3px solid #ad580a; outline-offset: 3px }
.quiz-tier input:focus-visible + .quiz-bars { outline: 0 }
.quiz-launch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px }
.quiz-launch button,#quiz-change { min-height: 44px; padding: 7px 13px; border-radius: 6px; font-size: .86rem; font-weight: 680 }
.quiz-launch #quiz-start:disabled { background: #e4e9e3; border-color: #c6d0c8; color: #50635c; cursor: not-allowed }
#quiz-continue,#quiz-change { background: transparent; color: #245247; border: 1px solid #9ab3a4 }
#quiz-change { font-size: .78rem; padding: 4px 9px }
#quiz-level-badge { border-radius: 99px; padding: 4px 10px; background: #e0ece3; color: #224d42; font-size: .77rem; font-weight: 720; line-height: 1.35 }
.quiz-setup .quiz-setup-note { font-size: .83rem; margin: 0 0 9px }
@media(hover:hover) { .quiz-tier:hover { border-color: #477a64; background: #f5f8ee } }
@media(max-width:660px) {
  .quiz-level-list { grid-template-columns: 1fr; gap: 7px; margin: 12px 0 }
  .quiz-tier { grid-template-columns: 25px minmax(0,1fr); align-content: center; align-items: center; gap: 3px 8px; padding: 10px 38px 10px 11px }
  .quiz-bars { grid-row: 1/3; margin: 0 }.quiz-tier input { top: 50%; right: 10px; transform: translateY(-50%) }
  .quiz-tier-copy { grid-column: 2; max-width: none }
  .quiz-boardbar { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "level change" "round score" "progress progress"; align-items: center; gap: 3px 8px }
  #quiz-level-badge { grid-area: level; justify-self: start }#quiz-round { grid-area: round }#quiz-progress { grid-area: progress }
  #quiz-score { grid-area: score }#quiz-change { grid-area: change; justify-self: end }
}

/* Duel : choix compact au départ, un seul repère supplémentaire pendant le point. */
#quiz-format { margin: 15px 0 12px }
#quiz-level-form legend,.quiz-rival-setup label,#quiz-guess-form label { color: #23493e; font-weight: 700; font-size: .85rem }
.quiz-formats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 5px }
.quiz-formats label { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 8px 11px; border: 1px solid #aebfb4; border-radius: 7px; cursor: pointer; color: #254a40; background: #fff }
.quiz-formats label:has(input:checked) { background: #edf5e6; border-color: #32715d; box-shadow: inset 0 0 0 1px #32715d }
.quiz-formats input { flex: 0 0 auto; margin: 0; width: 16px; height: 16px; accent-color: #20594d }
.quiz-formats strong,.quiz-formats small { display: block; line-height: 1.3 }
.quiz-formats strong { font-size: .94rem }.quiz-formats small { margin-top: 2px; font-size: .8rem; color: #425f54 }
#quiz-format ~ fieldset .quiz-level-list { margin-top: 5px }
.quiz-rival-setup { display: grid; grid-template-columns: minmax(170px,.72fr) minmax(0,1.28fr); align-items: center; gap: 8px 16px; padding: 10px 12px; margin: 0 0 12px; border-left: 3px solid #347260; border-radius: 4px; background: #eef4ed }
.quiz-rival-setup:has(#quiz-rival-choice[hidden]) { display: block }
.quiz-rival-setup label,#quiz-guess-form label { display: block; margin-bottom: 4px }
.quiz-rival-setup select,#quiz-guess { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; padding: 5px 7px; border: 1px solid #8da49a; border-radius: 6px; background: white; color: #1c4137; font: inherit }
#quiz-rival-note,#quiz-duel-hint { color: #34554b; font-size: .84rem; line-height: 1.42 }
.quiz-duel-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 11px; padding: 8px 12px; margin: 0 0 7px; border-radius: 6px; color: #f5faf2; background: #1a4546 }
.quiz-duel-strip > span { color: #ddf895; font-size: .72rem; font-weight: 720; letter-spacing: .05em; text-transform: uppercase }
.quiz-duel-strip strong { font-size: .94rem }.quiz-duel-strip small { margin-left: auto; font-size: .78rem; color: #daede8 }
#quiz-duel-hint { margin-top: 8px; padding-left: 9px; border-left: 3px solid #92ac69 }
.quiz-identify { background: var(--at-paper); border: 1px solid var(--at-line); border-top: 4px solid #377563; border-radius: 10px; padding: clamp(14px,2.3vw,26px) }
.quiz-identify h2 { font-size: clamp(1.2rem,2.1vw,1.7rem); line-height: 1.15; margin: 5px 0 7px; color: #173a40 }
.quiz-identify > p:not(.quiz-kicker),.quiz-scout > p:not(.quiz-kicker) { font-size: .9rem; line-height: 1.45; color: #34504b }
.quiz-identify details { margin: 12px 0; border-block: 1px solid var(--at-line) }
.quiz-identify summary { align-content: center; min-height: 44px; font-weight: 650; color: #225749 }
#quiz-observations { padding-left: 22px; margin: 0 0 12px }
#quiz-observations li { padding: 5px 0; max-width: 66ch }#quiz-observations span { display: block; font-size: .87rem }
#quiz-guess-form { display: grid; grid-template-columns: minmax(0,17rem) max-content; align-items: end; gap: 3px 8px }
#quiz-guess-form label { grid-column: 1/-1 }
#quiz-reveal-profile { min-height: 44px; padding: 7px 12px; font-weight: 680; border-radius: 6px }
#quiz-reveal-profile:disabled { color: #50635c; background: #e4e9e3; border-color: #c6d0c8; cursor: not-allowed }
.quiz-scout { margin-top: 12px; padding: 12px 14px; border-left: 3px solid #397764; background: #edf5ed; border-radius: 5px }
.quiz-scout p:not(.quiz-kicker) { margin-top: 5px; max-width: 72ch }
#quiz-scout-result { font-weight: 650 }
@media(max-width:600px) {
  .quiz-rival-setup,#quiz-guess-form { grid-template-columns: minmax(0,1fr) }
  #quiz-reveal-profile { justify-self: start; margin-top: 5px }
  .quiz-formats label { gap: 6px; padding: 6px 8px }.quiz-formats small { font-size: .76rem }
}
@media(max-width:420px) {
  #quiz-level-form:has([value="duel"]:checked) .quiz-tier { min-height: 46px }
  /* L'explication du niveau choisi reste visible ; les autres restent lisibles au lecteur d'écran. */
  #quiz-level-form:has([value="duel"]:checked) .quiz-tier:not(:has(:checked)) .quiz-tier-copy {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
