/* QCM du jour — reprend les styles de l'appli (assets/app.css) */
body.qcm { min-height: 100dvh; background: var(--bg); overscroll-behavior: none; }
.qcm [hidden] { display: none !important; }
.q-hero-bg { background: linear-gradient(170deg, var(--red-hi) 0%, var(--red) 40%, var(--red-deep) 100%); color: #fff; }

/* Connexion */
.q-login { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.q-login-top { padding: calc(var(--safe-t) + 48px) 24px 96px; text-align: center; color: #fff;
  background: linear-gradient(170deg, var(--red-hi) 0%, var(--red) 40%, var(--red-deep) 100%); }
.q-logo { width: 64px; height: 64px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 20px; background: #fff; color: var(--red);
  font-family: var(--font-cond); font-weight: 800; font-size: 40px; box-shadow: 0 8px 0 rgba(0,0,0,.15); transform: rotate(-6deg); }
.q-login-top h1 { margin: 0; font-family: var(--font-cond); font-size: 40px; }
.q-login-top p { margin: 8px auto 0; max-width: 30ch; opacity: .9; }
.q-login-card { width: min(420px, calc(100% - 32px)); margin: -64px auto 32px; padding: 22px; border-radius: 26px; background: var(--surface); box-shadow: var(--sh-float); display: grid; gap: 12px; align-self: start; }
.q-login-card label { font-weight: 700; }
#loginBob { display: grid; place-items: center; margin-top: -70px; }
.q-code { font-family: var(--font-cond); font-size: 30px; font-weight: 800; letter-spacing: .2em; text-align: center; }
.q-hint { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* Accueil */
.q-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: calc(var(--safe-t) + 22px) 20px 92px; color: #fff;
  background: linear-gradient(170deg, var(--red-hi) 0%, var(--red) 40%, var(--red-deep) 100%); }
.q-kicker { margin: 0; font-size: 13px; font-weight: 700; opacity: .85; text-transform: uppercase; letter-spacing: .08em; }
.q-head h1 { margin: 2px 0 0; font-family: var(--font-cond); font-size: 34px; line-height: 1.05; }
.q-date { margin: 4px 0 0; opacity: .85; font-size: 14px; }
.q-head-actions { display: flex; align-items: center; gap: 8px; }
.q-streak { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.18); font-weight: 800; font-size: 14px; white-space: nowrap; }
.q-main { max-width: 760px; margin: -70px auto 0; padding: 0 16px calc(var(--safe-b) + 32px); display: grid; gap: 14px; }

.q-today { display: grid; gap: 14px; padding: 18px; }
.q-today-top { display: flex; align-items: center; gap: 14px; }
.q-today-top h2 { margin: 0; font-family: var(--font-cond); font-size: 26px; line-height: 1.05; }
.q-today-top p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.q-chip { padding: 5px 10px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.q-done { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.q-stat { padding: 12px 8px; border-radius: 16px; background: var(--surface-2); text-align: center; }
.q-stat b { display: block; font-family: var(--font-cond); font-size: 28px; line-height: 1; color: var(--red); }
.q-stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.q-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.q-actions .btn { flex: 1 1 180px; }
.q-next-in { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }

.q-board { padding: 18px; }
.q-board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.q-board-head h2 { margin: 0; font-family: var(--font-cond); font-size: 24px; }
.q-tabs { grid-template-columns: repeat(4, 1fr); margin: 0; flex: 1 1 280px; max-width: 380px; }
.q-tabs button { min-height: 34px; font-size: 13px; }
.q-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; margin: 6px 0 14px; }
.q-step { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.q-step b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-step small { font-size: 12px; color: var(--muted); font-weight: 700; }
.q-block { width: 100%; border-radius: 14px 14px 6px 6px; display: grid; place-items: center; font-family: var(--font-cond); font-weight: 800; font-size: 26px; color: #fff;
  background: linear-gradient(180deg, var(--red-hi), var(--red-deep)); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.q-step-1 .q-block { height: 78px; background: linear-gradient(180deg, #F7C948, #D99A0B); }
.q-step-2 .q-block { height: 58px; background: linear-gradient(180deg, #C9CDD4, #9AA0AA); }
.q-step-3 .q-block { height: 44px; background: linear-gradient(180deg, #E0A77A, #B26B38); }
.q-medal { font-size: 22px; }
.q-ini { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-cond); font-weight: 800; font-size: 16px;
  color: #fff; background: var(--ini, var(--red)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.q-ini-lg { width: 52px; height: 52px; font-size: 20px; border-radius: 16px; }
.q-rows { display: grid; gap: 4px; }
.q-row { display: grid; grid-template-columns: 32px 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; }
.q-row.is-me { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red-line); }
.q-rank { font-family: var(--font-cond); font-weight: 800; font-size: 18px; color: var(--muted); text-align: center; }
.q-who b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-who small { font-size: 12px; color: var(--muted); }
.q-pts { font-family: var(--font-cond); font-weight: 800; font-size: 20px; white-space: nowrap; }
.q-pts small { font-family: var(--font); font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.q-empty { display: grid; justify-items: center; gap: 8px; padding: 10px 0 4px; text-align: center; color: var(--muted); font-size: 14px; }
.q-rules summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.q-rules { padding: 14px 18px; }
.q-rules ul { margin: 10px 0 2px; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; }

/* Partie */
.q-play { min-height: 100dvh; display: grid; grid-template-rows: auto auto 1fr; max-width: 680px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px calc(var(--safe-b) + 16px); gap: 12px; }
.q-play-top { display: flex; align-items: center; gap: 10px; }
.q-quit { font-size: 24px; }
.q-dots { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.q-dots i { height: 8px; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.q-dots i.is-now { background: var(--ink); box-shadow: none; }
.q-dots i.is-ok { background: #17A659; box-shadow: none; }
.q-dots i.is-ko { background: var(--red); box-shadow: none; }
.q-score { font-family: var(--font-cond); font-weight: 800; font-size: 20px; min-width: 70px; text-align: right; }
.q-timer { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.q-timer span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #17A659, #F2B33D 60%, var(--red)); background-size: 300% 100%; transform-origin: left; }
.q-qcard { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 26px; background: var(--surface); box-shadow: var(--sh-card); align-self: start; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-theme { padding: 5px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 13px; }
.q-diff { font-size: 13px; color: var(--muted); font-weight: 700; }
.q-sec { margin-left: auto; font-family: var(--font-cond); font-weight: 800; font-size: 26px; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.q-sec.is-low { color: var(--red); animation: q-pulse 1s ease-in-out infinite; }
@keyframes q-pulse { 50% { transform: scale(1.15); } }
.q-question { margin: 0; font-family: var(--font-cond); font-size: clamp(24px, 6vw, 32px); line-height: 1.12; }
.q-answers { display: grid; gap: 10px; }
.q-ans { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border: 0; border-radius: 16px; text-align: left;
  background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer;
  transition: transform .12s, background .2s, box-shadow .2s; }
.q-ans:hover:not([disabled]) { box-shadow: inset 0 0 0 2px var(--ink); }
.q-ans:active:not([disabled]) { transform: scale(.98); }
.q-ans .q-letter { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); font-family: var(--font-cond); font-weight: 800; font-size: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.q-ans[disabled] { cursor: default; }
.q-ans.is-good { background: #E3F6EB; box-shadow: inset 0 0 0 2px #17A659; color: #0B5E35; }
.q-ans.is-good .q-letter { background: #17A659; color: #fff; box-shadow: none; }
.q-ans.is-bad { background: var(--red-soft); box-shadow: inset 0 0 0 2px var(--red); color: var(--red-deep); }
.q-ans.is-bad .q-letter { background: var(--red); color: #fff; box-shadow: none; }
.q-ans.is-dim { opacity: .5; }
.q-feedback { margin: 0; min-height: 24px; font-weight: 800; font-size: 17px; text-align: center; }
.q-feedback.ok { color: #12884A; } .q-feedback.ko { color: var(--red); }
html[data-theme="dark"] .q-ans.is-good { background: rgba(23,166,89,.18); color: #8FE0B0; }

/* Fin */
.q-end { max-width: 680px; margin: 0 auto; padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 24px); display: grid; gap: 14px; }
.q-end-card { display: grid; justify-items: center; gap: 10px; padding: 24px 18px; text-align: center; }
.q-end-card h2 { margin: 0; font-family: var(--font-cond); font-size: 32px; }
.q-big { font-family: var(--font-cond); font-weight: 800; font-size: 64px; line-height: 1; color: var(--red); }
.q-end-card p { margin: 0; color: var(--ink-2); }
.q-recap { padding: 16px 18px; display: grid; gap: 10px; }
.q-recap h3 { margin: 0 0 4px; font-family: var(--font-cond); font-size: 22px; }
.q-rq { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.q-rq:first-of-type { border-top: 0; }
.q-rq b { font-size: 15px; }
.q-rq small { color: var(--muted); font-size: 12px; font-weight: 600; }
.q-rq .ok { color: #12884A; font-weight: 700; } .q-rq .ko { color: var(--red); font-weight: 700; }

@media (min-width: 760px) {
  .q-head { padding: 34px 32px 100px; }
  .q-head > div:first-child, .q-head-actions { max-width: 760px; }
  .q-head { justify-content: center; gap: calc(100vw - 760px - 64px); }
  .q-answers { grid-template-columns: 1fr 1fr; }
  .q-play { align-content: center; }
}
@media (max-width: 380px) {
  .q-tabs button { font-size: 12px; padding: 0 2px; }
  .q-ans { min-height: 52px; font-size: 15px; }
  .q-row { grid-template-columns: 26px 36px minmax(0, 1fr) auto; gap: 8px; }
  .q-ini { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .q-sec.is-low { animation: none; } }
.q-play .icon-btn, .q-quit { background: var(--surface); color: var(--ink); box-shadow: var(--sh-card); border: 0; }
