/* Grammar Quiz Show — a TV quiz show on a light board.
   The show feel comes from the accents: a row of studio bulbs, four coloured
   answer letters like buzzers, a big clock, a streak flame. The board itself
   stays white with dark ink (everything a learner reads passes 4.5:1). */

/* ── menu ─────────────────────────────────────────────────────────────── */
.qz-modes { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qz-mode { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 16px 18px; border-radius: 18px; border: 2px solid var(--line); background: var(--cyc); color: var(--ink); cursor: pointer; position: relative; transition: border-color .2s, box-shadow .2s, transform .3s var(--ease-out); }
.qz-mode:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.qz-mode:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
.qz-mode[aria-checked="true"] { border-color: var(--sound); box-shadow: 0 0 0 4px var(--sound-soft); }
.qz-mode.practice[aria-checked="true"] { border-color: var(--wb); box-shadow: 0 0 0 4px var(--wb-soft); }
.qz-mode-ico { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--sound-soft); }
.qz-mode.practice .qz-mode-ico { background: var(--wb-soft); }
.qz-mode-body { display: grid; gap: 4px; min-width: 0; padding-right: 26px; }
.qz-mode-name { font-family: var(--f-display); font-size: 1.25rem; letter-spacing: -.02em; font-variation-settings: 'opsz' 36, 'wght' 750; }
.qz-mode-why { font-size: 1rem; line-height: 1.45; color: var(--ink-2); }
.qz-mode-tick { position: absolute; right: 14px; top: 14px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); }
.qz-mode[aria-checked="true"] .qz-mode-tick { border-color: var(--sound); background: var(--sound) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }
.qz-mode.practice[aria-checked="true"] .qz-mode-tick { border-color: var(--wb); background-color: var(--wb); }
@media (max-width: 640px) { .qz-modes { grid-template-columns: minmax(0, 1fr); } }

.qz-fix { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px 18px; border-radius: 18px; border: 2px solid var(--live); background: #FFF6F5; color: var(--ink); cursor: pointer; transition: transform .3s var(--ease-out), box-shadow .3s; }
.qz-fix:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.qz-fix:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
.qz-fix-ico { flex: none; font-size: 1.6rem; }
.qz-fix > span:nth-child(2) { display: grid; gap: 2px; flex: 1; min-width: 0; }
.qz-fix b { font-family: var(--f-display); font-size: 1.2rem; font-variation-settings: 'wght' 750; }
.qz-fix span span { font-size: 1rem; color: var(--ink-2); line-height: 1.45; }
.qz-fix-go { flex: none; font-family: var(--f-display); font-size: 1.4rem; color: #B3241C; }

.qz-tps { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.qz-tp { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; min-height: 64px; text-align: left; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--cyc); color: var(--ink); cursor: pointer; transition: border-color .2s, transform .3s var(--ease-out); }
.qz-tp:hover { border-color: var(--ink); transform: translateY(-2px); }
.qz-tp:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
.qz-tp-ico { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--cyc-2); }
.qz-tp-name { font-family: var(--f-display); font-size: 1.05rem; line-height: 1.2; font-variation-settings: 'opsz' 24, 'wght' 700; }
.qz-tp-meta { font-size: .9rem; color: var(--ink-2); }

/* ── the stage ────────────────────────────────────────────────────────── */
.qz-stage { position: relative; display: grid; gap: 14px; padding: 30px clamp(16px, 3vw, 32px) clamp(20px, 3vw, 30px); border-radius: 24px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(36, 87, 245, .10), transparent 55%),
    radial-gradient(120% 90% at 100% 0%, rgba(232, 53, 43, .08), transparent 55%),
    radial-gradient(80% 60% at 50% 110%, rgba(255, 210, 30, .20), transparent 70%),
    #FBFCFF;
  border: 2px solid #D6DEF8; }
.qz-bulbs { position: absolute; left: 0; right: 0; top: 9px; height: 10px; background: radial-gradient(circle, var(--sun) 3.2px, transparent 4px) 0 50% / 24px 10px repeat-x; opacity: .9; animation: qz-bulbs 1.6s steps(2) infinite; }
@keyframes qz-bulbs { 50% { background-position: 12px 50%; } }
.qz-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.qz-kicker { font-family: var(--f-display); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--sound-2); font-variation-settings: 'wght' 700; }
.qz-streak { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: var(--cyc); box-shadow: inset 0 0 0 1.5px var(--line); font-family: var(--f-display); font-size: .92rem; color: var(--ink-2); font-variation-settings: 'wght' 650; transition: background .3s, color .3s; }
.qz-streak.cold > span { filter: grayscale(1); opacity: .5; }
.qz-streak.hot { background: #FFF1DA; color: #8A4B00; box-shadow: inset 0 0 0 2px var(--sun); }
.qz-streak b { font-variation-settings: 'wght' 800; color: #B3241C; }
.qz-streak.pop { animation: qz-pop .6s var(--ease-out); }
@keyframes qz-pop { 30% { transform: scale(1.25) rotate(-3deg); } }

.qz-clock { display: flex; align-items: center; gap: 12px; }
.qz-clock-bar { flex: 1; height: 12px; border-radius: 6px; background: var(--cyc-3); overflow: hidden; }
.qz-clock-bar i { display: block; height: 100%; width: 100%; border-radius: 6px; background: var(--sound); transition: width 1s linear, background .3s; }
.qz-clock b { flex: none; min-width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--cyc); box-shadow: inset 0 0 0 3px var(--sound); font-family: var(--f-display); font-size: 1.35rem; font-variant-numeric: tabular-nums; color: var(--ink); font-variation-settings: 'wght' 800; transition: box-shadow .3s, color .3s; }
.qz-clock.mid .qz-clock-bar i { background: var(--sun); } .qz-clock.mid b { box-shadow: inset 0 0 0 3px var(--sun); }
.qz-clock.low .qz-clock-bar i { background: var(--live); } .qz-clock.low b { box-shadow: inset 0 0 0 3px var(--live); color: #B3241C; animation: qz-beat 1s ease-in-out infinite; }
@keyframes qz-beat { 50% { transform: scale(1.1); } }

.qz-ctx { justify-self: center; padding: 8px 16px; border-radius: 12px; background: var(--cyc); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 1.05rem; color: var(--ink-2); text-align: center; }
.qz-q { text-align: center; font-family: var(--f-display); font-size: clamp(1.45rem, 1.1rem + 1.7vw, 2.3rem); line-height: 1.3; letter-spacing: -.02em; text-wrap: balance; color: var(--ink); font-variation-settings: 'opsz' 60, 'wght' 700; padding: 6px 0 4px; }
.qz-gap { display: inline-block; min-width: 3.4em; border-bottom: 4px solid var(--sound); margin: 0 .08em; line-height: 1.05; color: var(--sound-2); transition: background .3s; }
.qz-gap.filled { min-width: 0; padding: 0 .2em; border-radius: 6px 6px 0 0; background: var(--pen-soft); color: var(--ink); border-bottom-color: #1F9D55; animation: qz-pop .5s var(--ease-out); }

/* four answers, each with a coloured buzzer letter */
.qz-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qz-opt { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px 10px 10px; border-radius: 18px; border: 2px solid var(--line-2); background: var(--cyc); color: var(--ink); text-align: left; cursor: pointer; transition: transform .25s var(--ease-out), border-color .2s, background .2s, box-shadow .2s, opacity .3s; }
.qz-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--ink); box-shadow: var(--shadow-1); }
.qz-opt:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
.qz-opt:disabled { cursor: default; }
.qz-let { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-display); font-size: 1.15rem; color: #fff; font-variation-settings: 'wght' 800; }
.qz-let.l0 { background: var(--sound); } .qz-let.l1 { background: #D02A6E; } .qz-let.l2 { background: #9E5400; } .qz-let.l3 { background: #17763F; }
.qz-opt-t { font-family: var(--f-display); font-size: 1.2rem; line-height: 1.25; font-variation-settings: 'opsz' 24, 'wght' 650; }
.qz-opt-t i { font-style: normal; color: var(--ink-2); }
.qz-opt.right { border-color: #1F9D55; background: #E5F6EC; animation: qz-pop .5s var(--ease-out); }
.qz-opt.right .qz-let { background: #1F9D55; font-size: 0; } .qz-opt.right .qz-let::after { content: "✓"; font-size: 1.3rem; }
.qz-opt.wrong { border-color: var(--live); background: var(--live-soft); }
.qz-opt.wrong .qz-let { background: var(--live); font-size: 0; } .qz-opt.wrong .qz-let::after { content: "✗"; font-size: 1.3rem; }
.qz-opt.dim { opacity: .5; }
.qz-opt.gone { opacity: .18; transform: scale(.97); }
@media (max-width: 560px) { .qz-opts { grid-template-columns: minmax(0, 1fr); } .qz-opt { min-height: 58px; } }

.qz-life { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.qz-life-lab { font-family: var(--f-display); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-variation-settings: 'wght' 700; }
.qz-lifeline { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--sun); background: #FFF8EC; color: var(--ink); font-size: .95rem; cursor: pointer; transition: transform .2s var(--ease-out), background .2s; }
.qz-lifeline b { font-family: var(--f-display); font-variation-settings: 'wght' 800; margin-right: 4px; }
.qz-lifeline:hover:not(:disabled) { transform: translateY(-2px); background: var(--pen-soft); }
.qz-lifeline:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; border-color: var(--line-2); background: var(--cyc-2); }
.qz-keys { text-align: center; }

/* ── feedback that teaches ───────────────────────────────────────────── */
.qz-fb { display: grid; gap: 14px; padding: 18px clamp(16px, 2.6vw, 24px); border-radius: 20px; border: 2px solid #A7DDBE; background: #F3FBF6; animation: gm-in .35s var(--ease-out); }
.qz-fb.bad { border-color: #F3B7B2; background: #FFF8F7; }
.qz-fb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-family: var(--f-display); font-variation-settings: 'wght' 750; }
.qz-fb-head b { font-size: 1.35rem; color: #136B39; }
.qz-fb.bad .qz-fb-head b { color: #B3241C; }
.qz-fb-head span { font-size: 1.05rem; padding: 4px 12px; border-radius: 999px; background: var(--cyc); color: #136B39; }
.qz-fb.bad .qz-fb-head span { color: var(--ink-2); }
.qz-you { font-size: 1.08rem; line-height: 1.55; color: var(--ink); }
.qz-chip { display: inline-block; padding: 1px 10px; border-radius: 8px; font-family: var(--f-display); font-variation-settings: 'wght' 700; margin-right: 4px; }
.qz-chip.bad { background: var(--live-soft); color: #B3241C; text-decoration: line-through; text-decoration-thickness: 2px; }
.qz-said { display: grid; gap: 10px; justify-items: center; padding: 16px; border-radius: 16px; background: var(--cyc); box-shadow: inset 0 0 0 1.5px var(--line); }
.qz-said-t { font-family: var(--f-display); font-size: clamp(1.25rem, 1.05rem + .9vw, 1.7rem); line-height: 1.35; text-align: center; text-wrap: balance; font-variation-settings: 'opsz' 48, 'wght' 650; }
.qz-said-t mark, .qz-rv-t mark { background: linear-gradient(transparent 12%, var(--pen) 12%, var(--pen) 88%, transparent 88%); color: var(--ink); padding: 0 .1em; border-radius: 3px; }
.qz-hears { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.qz-hear { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 0; background: var(--sound); color: #fff; font-family: var(--f-display); font-size: 1rem; font-variation-settings: 'wght' 700; cursor: pointer; transition: transform .2s var(--ease-out), background .2s; }
.qz-hear:hover { background: var(--sound-2); transform: translateY(-1px); }
.qz-hear.slow { background: var(--cyc); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.qz-hear.on { animation: lu-pulse 1s ease-in-out infinite; }
.qz-hear.mini { flex: none; width: 44px; height: 44px; padding: 0; justify-content: center; font-size: .95rem; }
.qz-why { font-size: 1.08rem; line-height: 1.55; color: var(--ink); }
.qz-why b { font-family: var(--f-display); color: var(--sound-2); font-variation-settings: 'wght' 750; }
.qz-fb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.qz-voice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .95rem; color: var(--ink-2); cursor: pointer; }
.qz-voice input { width: 20px; height: 20px; accent-color: var(--sound); }
.qz-fb-foot .btn { margin-left: auto; }
@media (max-width: 560px) { .qz-fb-foot .btn { width: 100%; } }

/* ── results ──────────────────────────────────────────────────────────── */
.gm-results .review li:has(.qz-rv) { padding: 0; background: none; }
.qz-rv { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #F3FBF6; border: 1.5px solid #CBEBD8; }
.qz-rv.bad { background: #FFF8F7; border-color: #F3C9C5; }
.qz-rv-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #1F9D55; color: #fff; font-weight: 700; margin-top: 2px; }
.qz-rv.bad .qz-rv-mark { background: var(--live); }
.qz-rv-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.qz-rv-t { font-family: var(--f-display); font-size: 1.1rem; line-height: 1.4; color: var(--ink); font-variation-settings: 'opsz' 24, 'wght' 650; }
.qz-rv-why { font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.qz-rv-why b { color: #B3241C; }

@media (prefers-reduced-motion: reduce) {
  .qz-bulbs, .qz-clock.low b, .qz-hear.on, .qz-streak.pop, .qz-opt.right, .qz-gap.filled { animation: none; }
}

/* the board scrolls into view below the sticky nav, not under it */
.gm-board[data-game="quiz"] { scroll-margin-top: calc(var(--bar-h, 64px) + 16px); }
.gm-results .review:has(.qz-rv) { padding-left: 0; margin-left: 0; }
