/* ── QUIZ "Vero o falso?" a mazzo di carte ──
   Mappare le variabili sul sito: --q-dark (carta), --q-acc (accento), --q-ok (giusto), --q-soft (sfondo chiaro) */
.quiz-sec { position: relative; overflow: hidden; }
.quiz-head { text-align: center; max-width: 640px; margin: 0 auto 34px; }
.quiz-head .label { justify-content: center; }
.quiz { max-width: 560px; margin: 0 auto; }
.quiz-progress { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; }
.quiz-progress i { width: 34px; height: 5px; border-radius: 5px; background: var(--q-soft); transition: background .4s, width .4s; }
.quiz-progress i.on { background: var(--q-acc); width: 48px; }
.quiz-progress i.ok { background: var(--q-ok); }
.quiz-progress i.ko { background: var(--q-acc); opacity: .55; }
.deck { display: grid; perspective: 1400px; }
.qcard { grid-area: 1 / 1; display: grid; transform-style: preserve-3d; transition: transform .75s var(--ease), opacity .5s; transform-origin: 50% 100%; }
.qcard.behind-1 { transform: translateY(16px) scale(.95) rotate(-2deg); z-index: 2; }
.qcard.behind-2 { transform: translateY(30px) scale(.9) rotate(2.5deg); z-index: 1; }
.qcard.behind-3, .qcard.hidden-card { transform: translateY(40px) scale(.86); opacity: 0; z-index: 0; pointer-events: none; }
.qcard.active { transform: none; z-index: 5; }
.qcard.active.flipped { transform: rotateY(180deg); }
.qcard.gone { transform: translateX(130%) rotate(16deg); opacity: 0; z-index: 6; pointer-events: none; }
.qcard.behind-1 .q-face, .qcard.behind-2 .q-face { pointer-events: none; }
.q-face { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; min-height: 300px; padding: 34px 32px; border-radius: 26px; -webkit-backface-visibility: hidden; backface-visibility: hidden; text-align: center; }
.q-front { background: var(--q-dark); color: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.22); }
.qcard.behind-1 .q-front, .qcard.behind-2 .q-front { box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.q-back { background: var(--white); color: var(--ink); transform: rotateY(180deg); box-shadow: 0 24px 60px rgba(0,0,0,.14); border: 2px solid var(--q-soft); }
.q-num { font-family: var(--ff-ui); font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; opacity: .7; }
.q-text { font-family: var(--ff-title); font-size: clamp(1.7rem, 4.4vw, 2.2rem); line-height: 1.15; color: #fff; }
.q-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.q-btns button { font-family: var(--ff-ui); font-weight: 600; font-size: 1.05rem; padding: 15px 0; border-radius: 16px; border: 2px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; transition: transform .2s, background .2s, border-color .2s; -webkit-tap-highlight-color: transparent; }
.q-btns button:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.6); transform: translateY(-2px); }
.q-btns button:active { transform: scale(.96); }
.q-btns button:focus-visible, .q-next:focus-visible, .q-restart:focus-visible { outline: 2px solid var(--q-acc); outline-offset: 3px; }
.q-verdict { align-self: center; display: inline-flex; align-items: center; gap: 8px; font-family: var(--ff-ui); font-weight: 700; font-size: .95rem; padding: 8px 16px; border-radius: 99px; }
.q-verdict.ok { background: color-mix(in srgb, var(--q-ok) 16%, white); color: var(--q-ok); }
.q-verdict.ko { background: color-mix(in srgb, var(--q-acc) 14%, white); color: var(--q-acc); }
.q-expl { font-family: var(--ff-body); font-size: 1.04rem; line-height: 1.7; color: var(--ink2); }
.q-next { align-self: center; font-family: var(--ff-ui); font-weight: 600; font-size: .95rem; background: var(--q-dark); color: #fff; border: 0; padding: 13px 26px; border-radius: 99px; cursor: pointer; transition: transform .2s; }
.q-next:hover { transform: translateX(3px); }
.q-end .q-front { background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--q-acc) 40%, var(--q-dark)), var(--q-dark) 70%); }
.q-score { font-family: var(--ff-title); font-size: 5.5rem; line-height: 1; color: #fff; }
.q-score span { display: inline-block; }
.q-end.active .q-score span { animation: scorePop .7s var(--ease) .3s both; }
@keyframes scorePop { from { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); } }
.q-end-text { font-family: var(--ff-body); font-size: 1.05rem; color: rgba(255,255,255,.85); max-width: 380px; margin: 0 auto; }
.q-end-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.q-cta { display: inline-block; font-family: var(--ff-ui); font-weight: 600; font-size: .95rem; background: var(--wa); color: #fff; padding: 14px 26px; border-radius: 99px; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.q-restart { font-family: var(--ff-ui); font-size: .85rem; font-weight: 600; background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.q-pop { position: absolute; pointer-events: none; width: 10px; height: 10px; border-radius: 50%; background: var(--q-ok); animation: qpop .9s ease-out forwards; z-index: 10; }
@keyframes qpop { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
@media (max-width: 600px) { .q-face { min-height: 320px; padding: 28px 22px; } .q-score { font-size: 4.6rem; } }
@media (prefers-reduced-motion: reduce) {
  .qcard { transition: opacity .3s; }
  .qcard.active.flipped { transform: none; }
  .qcard.active.flipped .q-front { visibility: hidden; }
  .q-back { transform: none; visibility: hidden; }
  .qcard.active.flipped .q-back { visibility: visible; }
  .qcard.gone { transform: none; }
}
.quiz .q-text { color: #fff; }
.quiz .q-expl { color: var(--ink2); }
.quiz .q-end-text { color: rgba(255,255,255,.85); }
.qcard.behind-1 .q-front { background: color-mix(in srgb, var(--q-acc) 70%, var(--q-dark)); }
.qcard.behind-2 .q-front { background: var(--q-acc); }
.qcard.behind-1 .q-front > *, .qcard.behind-2 .q-front > * { visibility: hidden; }
