/* ══════════════════════════════════════════════════════════════
   GRAMMAR QUIZ SHOW — builds on atividades.css and puzzles.css
══════════════════════════════════════════════════════════════ */

:root {
  --qz-blue:      #3f86e0;
  --qz-blue-text: #2a67b8;
  --qz-blue-soft: #9cc3f5;
  --qz-gold:      #f2c14e;
  --qz-gold-text: #a3750b;
  --qz-orange:    #c4640f;
}

.qz-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── Topic card preview (prize ladder, navy panel) ─── */
.qz-preview rect {
  fill: rgba(238, 242, 249, 0.2);
  transition: fill .3s ease;
}

.qz-preview rect.ok   { fill: var(--pz-green); }
.qz-preview rect.miss { fill: rgba(209, 129, 128, 0.45); }
.pz-theme-card:hover .qz-preview rect:not([class]) { fill: rgba(238, 242, 249, 0.32); }

/* ─── Header ─── */
.qz-sound-btn { padding: 6px 9px; }
.qz-sound-btn .qz-icon { width: 18px; height: 18px; }

/* ─── Shared buttons ─── */
.qz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .15s, opacity .2s;
}

.qz-btn:hover:not(:disabled) {
  color: var(--red);
  background: var(--red-08);
  border-color: var(--red-35);
}

.qz-btn:active:not(:disabled) { transform: scale(0.96); }

.qz-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.qz-btn.is-primary {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 10px 22px -8px rgba(166, 4, 4, 0.55);
}

.qz-btn.is-primary:hover:not(:disabled) { color: var(--white); background: var(--red-dark); border-color: var(--red-dark); }

.qz-btn.is-big {
  padding: 14px 28px;
  font-size: 1.1rem;
}

.qz-btn.is-big .qz-icon { width: 18px; height: 18px; }

.qz-btn.is-steal {
  color: var(--navy);
  background: var(--qz-gold);
  border-color: var(--qz-gold);
  box-shadow: 0 8px 22px rgba(242, 193, 78, 0.35);
  animation: qzGlow 1.1s ease-in-out infinite alternate;
}

.qz-btn.is-steal:hover:not(:disabled) { color: var(--navy); background: #ffd36b; border-color: #ffd36b; }

.qz-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.qz-turn-chip {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  padding: 4px 11px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--white);
  background: var(--navy-light);
  border-radius: 999px;
}

.qz-turn-chip.is-red  { background: var(--red); }
.qz-turn-chip.is-blue { background: var(--qz-blue); }

/* ─── Top bar (navy): points + timer ─── */
.qz-points {
  flex-shrink: 0;
  padding: 7px 12px;
  font-size: .9rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--white);
  border: 1px solid rgba(128, 149, 182, 0.4);
  border-radius: 9px;
  transition: background .3s, border-color .3s;
}

.qz-points b { color: var(--qz-gold); }

.qz-points.is-double {
  background: rgba(242, 193, 78, 0.14);
  border-color: var(--qz-gold);
}

.qz-timer {
  position: relative;
  flex-shrink: 0;
  width: 62px;
  height: 62px;
  color: var(--white);
  transition: opacity .3s;
}

.qz-timer svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.qz-timer circle {
  fill: none;
  stroke-width: 4;
}

.qz-timer-track { stroke: rgba(255, 255, 255, 0.15); }

.qz-timer-ring {
  stroke: var(--white);
  stroke-linecap: round;
  stroke-dasharray: 100;
  transition: stroke-dashoffset .1s linear, stroke .3s;
}

.qz-timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.qz-timer.is-low .qz-timer-ring { stroke: #ff5a5a; }
.qz-timer.is-low .qz-timer-num  { color: #ff8a8a; animation: qzBeat 1s ease-in-out infinite; }
.qz-timer.is-friend .qz-timer-ring { stroke: var(--qz-gold); }
.qz-timer.is-friend .qz-timer-num  { color: var(--qz-gold); }
.qz-timer.is-off .qz-timer-ring    { stroke: rgba(255, 255, 255, 0.35); }
.qz-timer.is-paused { opacity: .45; }

.pz-bar.is-muted .pz-bar-text { color: rgba(255, 255, 255, 0.75); }

/* ─── Stage ─── */
.qz-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* Centers the content while still allowing scroll when it is taller */
.qz-stage > * { margin: auto 0; }

.qz-stage.is-paused > * {
  opacity: .3;
  filter: blur(6px);
  pointer-events: none;
  transition: opacity .3s, filter .3s;
}

.qz-stage.is-paused::after {
  content: 'Paused';
  position: sticky;
  bottom: 50%;
  align-self: center;
  margin-top: -60px;
  padding: 12px 28px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--card-shadow-hover);
}

/* ─── Intro ─── */
.qz-intro {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0 12px;
  text-align: center;
  animation: pzBoardIn .55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

/* The marquee keeps the navy gameshow look */
.qz-marquee {
  position: relative;
  width: 100%;
  padding: 36px 40px 32px;
  color: var(--white);
  background:
    radial-gradient(ellipse 60% 90% at 50% 0%, rgba(209, 129, 128, 0.22) 0%, transparent 70%),
    var(--navy-panel);
  border-radius: 24px;
  box-shadow: 0 22px 44px -22px rgba(3, 45, 111, 0.6);
  overflow: hidden;
}

/* Marquee light bulbs along the border ("space" spreads them evenly on each side) */
.qz-marquee::before {
  --bulb: radial-gradient(circle, #ffe3a3 0 2.4px, rgba(255, 227, 163, 0.3) 3.4px, transparent 4.6px);
  content: '';
  position: absolute;
  inset: 9px;
  background:
    var(--bulb) left top    / 18px 10px,
    var(--bulb) left bottom / 18px 10px,
    var(--bulb) left top    / 10px 18px,
    var(--bulb) right top   / 10px 18px;
  background-repeat: space no-repeat, space no-repeat, no-repeat space, no-repeat space;
  animation: qzBulbs 1.2s steps(2, jump-none) infinite alternate;
  pointer-events: none;
}

.qz-marquee-kicker {
  position: relative;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--rose);
}

.qz-marquee-title {
  position: relative;
  margin: 8px 0 8px;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--white);
  text-shadow: 0 4px 30px rgba(166, 4, 4, 0.45);
}

.qz-marquee-desc {
  position: relative;
  font-size: 1.02rem;
  color: rgba(255, 255, 255, 0.72);
}

.qz-facts,
.qz-intro-lifelines {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
}

.qz-fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  font-size: .9rem;
  color: var(--ink-soft);
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.qz-fact .qz-icon { color: var(--red); }
.qz-fact b { color: var(--navy); }

.qz-types {
  font-size: .88rem;
  letter-spacing: .4px;
  color: var(--mute);
}

.qz-intro-label {
  margin-right: 2px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mute);
}

.qz-chip-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.qz-chip-mini .qz-icon { width: 14px; height: 14px; color: var(--qz-gold-text); }

.qz-x2 {
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: -.3px;
  color: var(--qz-gold-text);
}

.qz-setup {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.qz-modes {
  width: 100%;
  max-width: 680px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.qz-mode {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 13px;
  row-gap: 2px;
  align-items: center;
  padding: 14px 16px;
  font-family: inherit;
  text-align: left;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .3s var(--spring);
}

.qz-mode:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.qz-mode-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mute);
  background: var(--off-white);
  border-radius: 50%;
  transition: background .2s, color .2s;
}

.qz-mode-icon .qz-icon { width: 22px; height: 22px; }

.qz-mode-name {
  font-size: 1.05rem;
  font-weight: 800;
}

.qz-mode-desc {
  font-size: .82rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.qz-mode[aria-checked="true"] {
  background: var(--red-08);
  border-color: var(--red);
}

.qz-mode[aria-checked="true"] .qz-mode-icon {
  color: var(--white);
  background: var(--red);
}

.qz-mode.is-teams[aria-checked="true"] .qz-mode-icon {
  background: linear-gradient(135deg, var(--red) 50%, var(--qz-blue) 50%);
}

/* ─── Time per question ─── */
.qz-time {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qz-time .qz-intro-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qz-time .qz-intro-label .qz-icon {
  width: 14px;
  height: 14px;
  color: var(--red);
}

.qz-time-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.qz-time-opt {
  position: relative;
  min-width: 58px;
  padding: 9px 13px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .15s;
}

.qz-time-opt:hover {
  color: var(--navy);
  background: var(--white);
  border-color: var(--line);
}

.qz-time-opt:active { transform: scale(0.95); }

.qz-time-opt[aria-checked="true"] {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 8px 16px -6px rgba(166, 4, 4, 0.55);
}

/* Gold dot on the level's suggested time */
.qz-time-opt.is-suggested::after,
.qz-time-dot {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--qz-gold);
  border-radius: 50%;
}

.qz-time-opt.is-suggested::after {
  position: absolute;
  top: 4px;
  right: 5px;
}

.qz-time-note {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--mute);
}

.qz-resume {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  font-size: 1rem;
  color: var(--ink-soft);
}

.qz-resume b { color: var(--navy); }
.qz-resume-scores .qz-turn-chip { margin: 0 3px; }

/* ─── Countdown & question splash ─── */
.qz-countdown {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--navy);
  background:
    radial-gradient(ellipse 50% 45% at 50% 50%, rgba(166, 4, 4, 0.12) 0%, transparent 70%),
    rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 18px;
  cursor: pointer;
}

.qz-countdown.is-blue {
  background:
    radial-gradient(ellipse 50% 45% at 50% 50%, rgba(63, 134, 224, 0.16) 0%, transparent 70%),
    rgba(255, 255, 255, 0.86);
}

.qz-countdown-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: qzZoomIn .55s var(--spring) both;
}

.qz-countdown-big {
  font-size: clamp(2.8rem, 7.5vw, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  text-shadow: 0 8px 40px rgba(166, 4, 4, 0.25);
}

.qz-countdown.is-count .qz-countdown-big {
  font-family: var(--font-serif);
  font-size: clamp(6rem, 17vw, 12rem);
  font-variant-numeric: tabular-nums;
}

.qz-countdown-small {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red);
}

.qz-countdown.is-blue .qz-countdown-big   { text-shadow: 0 8px 40px rgba(63, 134, 224, 0.3); }
.qz-countdown.is-blue .qz-countdown-small { color: var(--qz-blue-text); }

/* ─── Question card ─── */
.qz-card {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 0 10px;
  animation: pzBoardIn .45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.qz-card.is-shake .qz-question { animation: qzShake .42s ease; }

.qz-card-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.qz-card-type {
  padding: 5px 13px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.qz-card-double {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--qz-gold);
  border-radius: 999px;
  animation: qzGlow .9s ease-in-out infinite alternate;
}

.qz-card-double .qz-x2 { color: var(--navy); }
.qz-card.is-double .qz-card-double { display: inline-flex; }

.qz-question {
  position: relative;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 34px;
  font-size: clamp(1.35rem, 2.5vw, 2.15rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: var(--navy);
  background: var(--pz-paper);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(3, 45, 111, 0.06),
    0 18px 36px -20px rgba(3, 45, 111, 0.35),
    inset 0 -4px 0 rgba(3, 45, 111, 0.1);
  transition: box-shadow .35s ease;
}

.qz-card.is-right .qz-question {
  box-shadow: 0 0 0 4px var(--pz-green), 0 18px 40px -16px rgba(63, 174, 122, 0.5);
}

.qz-source {
  font-size: .62em;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(3, 45, 111, 0.66);
}

.qz-hint {
  font-size: .66em;
  font-weight: 500;
  color: #5f739a;
}

.qz-gap {
  display: inline-block;
  min-width: 3.4em;
  margin: 0 .1em;
  padding: 0 .3em;
  line-height: 1.25;
  color: var(--red);
  border-bottom: 4px solid rgba(3, 45, 111, 0.35);
  border-radius: 6px 6px 0 0;
  transition: background .25s, color .25s, border-color .25s;
}

.qz-gap.is-preview { color: rgba(3, 45, 111, 0.45); border-bottom-style: dashed; }
.qz-gap.is-typing  { color: var(--navy); border-bottom-color: var(--rose); }

.qz-gap.is-picked {
  color: var(--white);
  background: var(--red);
  border-bottom-color: #6e0202;
  animation: qzBlink .45s ease-in-out infinite alternate;
}

.qz-gap.is-correct {
  color: var(--white);
  background: var(--pz-green);
  border-bottom-color: #2c8a5e;
  border-radius: 8px;
  animation: qzPop .5s var(--spring);
}

.qz-quote { transition: color .3s; }

.qz-quote.is-incorrect {
  text-decoration: line-through;
  text-decoration-color: rgba(166, 4, 4, 0.7);
  text-decoration-thickness: 3px;
}

.qz-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Options (multiple choice, correct or not) ─── */
.qz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qz-options.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.qz-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 14px 18px;
  font-family: inherit;
  font-size: clamp(1.05rem, 1.55vw, 1.35rem);
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  animation: qzRiseIn .45s cubic-bezier(0.22, 1, 0.36, 1) calc(0.08s + var(--i, 0) * 0.07s) backwards;
  transition: transform .25s var(--spring), border-color .2s, background .25s, color .25s, opacity .3s, box-shadow .25s;
}

.qz-option:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: var(--red-light);
  box-shadow: var(--card-shadow-hover);
}

.qz-option:active:not(:disabled) { transform: scale(0.97); }
.qz-option:disabled { cursor: default; }

.qz-key {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 800;
  color: var(--navy);
  background: var(--pz-paper);
  border-radius: 50%;
  transition: background .25s, color .25s;
}

.qz-key .qz-icon { width: 18px; height: 18px; }

.qz-option-text em {
  font-style: normal;
  font-weight: inherit;
  opacity: .65;
}

.qz-options.is-tf .qz-option {
  justify-content: center;
  min-height: 76px;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 700;
}

.qz-option.is-yes .qz-key { color: var(--white); background: var(--pz-green); }
.qz-option.is-no  .qz-key { color: var(--white); background: #c43b3b; }

.qz-option.is-picked {
  color: var(--white);
  background: var(--red);
  border-color: var(--red-light);
  animation: qzBlink .45s ease-in-out infinite alternate;
}

.qz-option.is-picked .qz-key { color: var(--red); background: var(--white); }

.qz-option.is-correct {
  color: var(--white);
  background: var(--pz-green);
  border-color: #2c8a5e;
  box-shadow: 0 12px 28px -10px rgba(63, 174, 122, 0.6);
  animation: qzPop .55s var(--spring);
}

.qz-option.is-correct .qz-key { color: #2c8a5e; background: var(--white); }

.qz-option.is-wrong {
  color: var(--red-dark);
  background: rgba(166, 4, 4, 0.07);
  border-color: var(--red-55);
  box-shadow: none;
  opacity: .85;
  animation: none;
}

.qz-option.is-wrong .qz-option-text { text-decoration: line-through; }
.qz-option.is-wrong .qz-key { color: var(--white); background: var(--red); }
.qz-option.is-dim { opacity: .4; }

.qz-option.is-removed {
  opacity: .15;
  transform: scale(0.95);
  filter: grayscale(1);
}

/* ─── Find the mistake ─── */
.qz-tokens { line-height: 1.85; }

.qz-token {
  margin: 0 -0.05em;
  padding: 0 .14em;
  font: inherit;
  line-height: 1.2;
  color: inherit;
  background: transparent;
  border: none;
  border-bottom: 3px dotted rgba(3, 45, 111, 0.28);
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, opacity .3s;
}

.qz-token:hover:not(:disabled) {
  background: rgba(166, 4, 4, 0.12);
  border-bottom-color: var(--red);
}

.qz-token:disabled { cursor: default; }
.qz-token.is-removed { color: rgba(3, 45, 111, 0.32); border-bottom-color: transparent; }

.qz-token.is-picked {
  color: var(--white);
  background: var(--red);
  border-bottom-color: transparent;
  animation: qzBlink .45s ease-in-out infinite alternate;
}

.qz-token.is-wrong {
  color: rgba(3, 45, 111, 0.5);
  background: rgba(166, 4, 4, 0.12);
  border-bottom-color: transparent;
  text-decoration: line-through;
}

/* The word that had to be found: green, like a correct option */
.qz-token.is-mistake {
  color: var(--white);
  background: var(--pz-green);
  border-bottom-color: transparent;
  animation: qzPop .5s var(--spring);
}

.qz-token-punct { color: inherit; }

/* ─── Word order ─── */
.qz-order-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 8px;
  min-height: 56px;
  width: 100%;
}

.qz-order-placeholder {
  font-size: .6em;
  font-weight: 500;
  color: #5f739a;
}

.qz-order-end {
  margin-left: -4px;
  font-weight: 800;
}

.qz-order-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
}

.qz-chip {
  padding: 10px 17px;
  font-family: inherit;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  animation: qzRiseIn .4s cubic-bezier(0.22, 1, 0.36, 1) calc(0.05s + var(--i, 0) * 0.05s) backwards;
  transition: transform .25s var(--spring), opacity .25s, border-color .2s, background .25s;
}

.qz-chip:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--red-light);
}

.qz-chip:disabled { cursor: default; }

.qz-chip.is-used {
  opacity: .2;
  transform: scale(0.94);
}

.qz-chip.is-placed {
  font-size: .72em;
  font-weight: 700;
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: none;
  animation: none;
}

.qz-chip.is-placed:hover:not(:disabled) { background: #0c3f8f; border-color: #0c3f8f; }
.qz-chip.is-fixed { color: var(--white); background: #5f769b; border-color: #5f769b; }
.qz-chip.is-new { animation: qzPop .35s var(--spring); }

.qz-order-line.is-right .qz-chip { color: var(--white); background: var(--pz-green); border-color: var(--pz-green); }
.qz-order-line.is-wrong .qz-chip { color: var(--white); background: #b04545; border-color: #b04545; }

/* ─── Fill the gap (typed) ─── */
.qz-typeform {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.qz-input {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  font-family: inherit;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 600;
  color: var(--navy);
  background: var(--off-white);
  border: 2px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.qz-input::placeholder { color: var(--mute); font-weight: 400; }

.qz-input:focus {
  background: var(--white);
  border-color: var(--red-light);
  box-shadow: 0 0 0 4px var(--red-08);
}

.qz-input:disabled { opacity: .6; }

.qz-type-hint {
  text-align: center;
  font-size: 1rem;
  color: var(--ink-soft);
}

.qz-type-hint b {
  font-size: 1.2rem;
  letter-spacing: 3px;
  color: var(--qz-gold-text);
}

/* ─── Feedback ─── */
.qz-feedback {
  padding: 16px 20px;
  color: var(--ink);
  background: var(--off-white);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 16px;
  animation: qzRiseIn .4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.qz-feedback.is-correct { border-color: var(--pz-green); background: rgba(63, 174, 122, 0.08); }
.qz-feedback.is-missed  { border-color: var(--red-55);   background: rgba(166, 4, 4, 0.05); }
.qz-feedback.is-steal   { border-color: var(--qz-gold);  background: rgba(242, 193, 78, 0.12); }

.qz-fb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.qz-fb-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: var(--red);
  border-radius: 50%;
}

.qz-feedback.is-correct .qz-fb-icon { background: var(--pz-green); }

.qz-fb-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
}

.qz-fb-points {
  padding: 3px 11px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  background: var(--pz-green);
  border-radius: 999px;
  animation: qzPop .5s var(--spring) .1s backwards;
}

.qz-fb-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qz-fb-parts span {
  padding: 3px 10px;
  font-size: .8rem;
  color: var(--ink-soft);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.qz-fb-parts b { color: var(--navy); }

.qz-fb-line {
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
}

.qz-fb-line span {
  margin-right: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--mute);
}

.qz-fb-line.is-given { font-weight: 500; color: var(--ink-soft); }

.qz-fb-explain {
  margin-top: 10px;
  padding-left: 12px;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
  border-left: 3px solid var(--rose);
}

.qz-fb-steal {
  margin-top: 8px;
  font-size: 1.05rem;
}

.qz-fb-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* ─── Toolbar ─── */
.qz-lifelines {
  display: flex;
  gap: 6px;
}

.qz-lifeline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.qz-lifeline .qz-icon { color: var(--qz-gold-text); }

.qz-board .pz-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.qz-board .pz-tool:disabled {
  opacity: .4;
  cursor: not-allowed;
  color: var(--navy);
  background: var(--white);
  border-color: var(--line);
}

.qz-lifeline.is-used span { text-decoration: line-through; }

/* In use on this question (double points, ask a friend) */
.qz-board .qz-lifeline.is-active,
.qz-board .qz-lifeline.is-active:disabled {
  opacity: 1;
  color: var(--navy);
  background: var(--qz-gold);
  border-color: var(--qz-gold);
}

.qz-lifeline.is-active span { text-decoration: none; }

.qz-lifeline.is-active .qz-icon,
.qz-lifeline.is-active .qz-x2 { color: var(--navy); }

/* ─── Scoreboard ─── */
.qz-scoreboard { padding: 12px 6px 2px; }

.qz-solo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px 16px;
  text-align: center;
  color: var(--navy);
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, rgba(166, 4, 4, 0.08) 0%, transparent 70%),
    var(--off-white);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.qz-solo-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--red);
}

.qz-solo-score {
  font-family: var(--font-serif);
  font-size: 3.3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.qz-solo-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 4px;
}

.qz-stat {
  font-size: .86rem;
  color: var(--mute);
}

.qz-stat b { color: var(--navy); }

.qz-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .86rem;
  font-weight: 700;
  color: var(--qz-orange);
}

.qz-streak b { color: inherit; }
.qz-streak.is-hot .qz-icon { animation: qzFlicker .6s ease-in-out infinite alternate; }

.qz-scoreboard.is-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.qz-team {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 10px;
  color: var(--navy);
  border: 2px solid var(--line);
  border-radius: 15px;
  transition: border-color .3s, box-shadow .3s, transform .35s var(--spring);
}

.qz-team.is-red  { background: linear-gradient(160deg, rgba(166, 4, 4, 0.12), rgba(166, 4, 4, 0.02)); border-color: rgba(166, 4, 4, 0.25); }
.qz-team.is-blue { background: linear-gradient(160deg, rgba(63, 134, 224, 0.14), rgba(63, 134, 224, 0.02)); border-color: rgba(63, 134, 224, 0.3); }

.qz-team.is-turn { transform: scale(1.03); }
.qz-team.is-red.is-turn  { border-color: var(--red); box-shadow: 0 10px 26px -10px rgba(166, 4, 4, 0.5); }
.qz-team.is-blue.is-turn { border-color: var(--qz-blue); box-shadow: 0 10px 26px -10px rgba(63, 134, 224, 0.55); }

.qz-team-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.qz-team-name {
  font-size: .9rem;
  font-weight: 800;
  white-space: nowrap;
}

.qz-team.is-red  .qz-team-name { color: var(--red); }
.qz-team.is-blue .qz-team-name { color: var(--qz-blue-text); }

.qz-team-turn {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.qz-team-turn::before {
  content: '';
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  animation: qzBlink .7s ease-in-out infinite alternate;
}

.qz-team.is-turn .qz-team-turn { display: inline-flex; }

.qz-team-score {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.qz-team-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 22px;
  gap: 6px;
}

.qz-team-lifelines {
  display: flex;
  gap: 3px;
  margin-left: auto;
}

.qz-mini-lifeline {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: opacity .3s;
}

.qz-mini-lifeline .qz-icon { width: 12px; height: 12px; color: var(--qz-gold-text); }
.qz-mini-lifeline .qz-x2 { font-size: .6rem; }
.qz-mini-lifeline.is-used { opacity: .3; }

/* ─── Question list ─── */
.qz-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}

.qz-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background .2s, border-color .2s;
}

.qz-item:not(:disabled) { cursor: pointer; }
.qz-item:not(:disabled):hover { background: var(--hover); }

.qz-item.is-current,
.qz-item.is-live {
  background: var(--hover-strong);
  border-color: var(--line-strong);
}

.qz-item-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 800;
  color: var(--mute);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: background .3s, color .3s, border-color .3s;
}

.qz-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qz-item-type {
  font-size: .9rem;
  font-weight: 600;
  color: var(--navy);
}

.qz-item-status {
  font-size: .76rem;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qz-item.is-live .qz-item-num {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
  animation: qzGlow .9s ease-in-out infinite alternate;
}

.qz-item.is-live.is-blue .qz-item-num { background: var(--qz-blue); border-color: var(--qz-blue); }
.qz-item.is-correct .qz-item-num { color: var(--white); background: var(--pz-green); border-color: var(--pz-green); }
.qz-item.is-stolen .qz-item-num  { color: var(--navy); background: var(--qz-gold); border-color: var(--qz-gold); }
.qz-item.is-missed .qz-item-num  { color: var(--white); background: var(--red-light); border-color: transparent; }
.qz-item.is-correct .qz-item-status { color: var(--pz-green-dark); }
.qz-item.is-stolen .qz-item-status  { color: var(--qz-gold-text); }

/* ─── Results ─── */
.qz-final {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 14px;
  text-align: center;
  color: var(--navy);
  animation: pzBoardIn .55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.qz-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.qz-star {
  width: 56px;
  height: 56px;
  color: rgba(3, 45, 111, 0.12);
}

.qz-star .qz-icon { width: 100%; height: 100%; }

.qz-star.is-on {
  color: var(--qz-gold);
  filter: drop-shadow(0 6px 12px rgba(242, 193, 78, 0.5));
  animation: qzStarPop .6s var(--spring) calc(0.25s + var(--i) * 0.2s) both;
}

.qz-star:nth-child(2) { transform: translateY(-10px); }
.qz-star.is-on:nth-child(2) { animation-name: qzStarPopHigh; }

.qz-final-title {
  margin-top: 6px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.02em;
}

.qz-final-score {
  font-family: var(--font-serif);
  font-size: clamp(3.4rem, 7vw, 5.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 8px 36px rgba(166, 4, 4, 0.2);
}

.qz-final-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mute);
}

.qz-final-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin: 16px 0 10px;
}

.qz-final-stats span {
  padding: 8px 15px;
  font-size: .92rem;
  color: var(--ink-soft);
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.qz-final-stats b { color: var(--navy); }
.qz-final-actions { margin-top: 10px; }

.qz-podium {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 16px;
  margin: 18px 0 10px;
}

.qz-podium-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 16px 20px;
  border: 2px solid;
  border-radius: 20px;
  transition: transform .4s;
}

.qz-podium-team.is-red  { background: linear-gradient(170deg, rgba(166, 4, 4, 0.14), rgba(166, 4, 4, 0.02)); border-color: rgba(166, 4, 4, 0.35); }
.qz-podium-team.is-blue { background: linear-gradient(170deg, rgba(63, 134, 224, 0.16), rgba(63, 134, 224, 0.02)); border-color: rgba(63, 134, 224, 0.4); }

.qz-podium-team.is-winner {
  padding-top: 20px;
  animation: qzWinner .7s var(--spring) .3s both;
}

.qz-podium-team.is-red.is-winner  { border-color: var(--red); box-shadow: 0 18px 40px -16px rgba(166, 4, 4, 0.5); }
.qz-podium-team.is-blue.is-winner { border-color: var(--qz-blue); box-shadow: 0 18px 40px -16px rgba(63, 134, 224, 0.55); }

.qz-podium-trophy {
  height: 42px;
  color: var(--qz-gold);
}

.qz-podium-trophy .qz-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 4px 10px rgba(242, 193, 78, 0.5));
}

.qz-podium-name {
  font-size: 1.1rem;
  font-weight: 800;
}

.qz-podium-team.is-red  .qz-podium-name { color: var(--red); }
.qz-podium-team.is-blue .qz-podium-name { color: var(--qz-blue-text); }

.qz-podium-team .qz-final-score { font-size: clamp(2.6rem, 5vw, 4rem); }

.qz-podium-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  font-size: .88rem;
  color: var(--ink-soft);
}

.qz-podium-stats b { color: var(--navy); }

/* ─── Results dialog ─── */
.qz-modal-icon {
  color: var(--navy);
  background: var(--qz-gold);
  box-shadow: 0 12px 28px -8px rgba(242, 193, 78, 0.7);
}

.qz-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 2px 0 12px;
}

.qz-results .qz-star { width: 40px; height: 40px; }

.qz-dialog-score {
  font-size: 1rem;
  color: var(--ink-soft);
}

.qz-dialog-score b {
  margin-right: 4px;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
}

.qz-dialog-teams {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.qz-dialog-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
  padding: 10px 18px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--navy);
  border: 2px solid;
  border-radius: 14px;
}

.qz-dialog-team b { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.qz-dialog-team.is-red  { border-color: rgba(166, 4, 4, 0.45); background: rgba(166, 4, 4, 0.07); }
.qz-dialog-team.is-blue { border-color: rgba(63, 134, 224, 0.5); background: rgba(63, 134, 224, 0.08); }
.qz-dialog-team.is-winner { box-shadow: 0 0 0 3px var(--qz-gold); }

/* ─── Effects ─── */
.qz-fx {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  pointer-events: none;
}

.qz-confetti {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: qzConfetti 1.4s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}

.qz-confetti.is-round {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.qz-float {
  position: absolute;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--pz-green-dark);
  text-shadow: 0 0 2px var(--white), 0 4px 14px rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  animation: qzFloat 1.3s ease-out forwards;
}

/* ─── Keyframes ─── */
@keyframes qzBulbs   { from { opacity: 1; } to { opacity: 0.45; } }
@keyframes qzRiseIn  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes qzZoomIn  { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes qzPop     { 0% { transform: scale(0.85); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes qzBlink   { from { filter: brightness(1); } to { filter: brightness(1.3); } }
@keyframes qzBeat    { 50% { transform: scale(1.18); } }
@keyframes qzGlow    { from { box-shadow: 0 0 0 rgba(242, 193, 78, 0); } to { box-shadow: 0 0 18px rgba(242, 193, 78, 0.7); } }
@keyframes qzFlicker { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.2) rotate(4deg); } }

@keyframes qzShake {
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes qzStarPop {
  from { opacity: 0; transform: scale(0.2) rotate(-40deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes qzStarPopHigh {
  from { opacity: 0; transform: translateY(-10px) scale(0.2) rotate(-40deg); }
  to   { opacity: 1; transform: translateY(-10px); }
}

@keyframes qzWinner {
  from { transform: none; }
  to   { transform: translateY(-12px); }
}

@keyframes qzConfetti {
  0%   { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(0.6); }
  55%  { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(calc(var(--rot) * 0.6)) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + var(--fall))) rotate(var(--rot)) scale(1); }
}

@keyframes qzFloat {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -12px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1); }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .qz-stage { overflow: visible; padding: 0; }
  .qz-stage > * { margin: 0; }
  .qz-countdown { position: fixed; border-radius: 0; z-index: 150; }
  .qz-timer { width: 54px; height: 54px; }
  .qz-timer-num { font-size: 1.15rem; }
  .qz-question { padding: 22px 20px; min-height: 110px; }
  .qz-marquee { padding: 30px 24px 26px; }
}

@media (max-width: 600px) {
  .qz-options,
  .qz-options.is-3 { grid-template-columns: 1fr; }
  .qz-options.is-tf { grid-template-columns: 1fr 1fr; }
  .qz-option { min-height: 56px; padding: 11px 14px; }
  .qz-modes { grid-template-columns: 1fr; }
  .qz-time-options { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .qz-time-opt { min-width: 0; padding: 9px 4px; }
  .qz-points { display: none; }
  .qz-typeform { flex-direction: column; }
  .qz-fb-actions { justify-content: stretch; }
  .qz-fb-actions .qz-btn { flex: 1; }
  .qz-podium { gap: 10px; }
  .qz-podium-stats { flex-direction: column; }
  .qz-lifeline span:not(.qz-x2) { display: none; }
  .qz-star { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .qz-marquee::before,
  .qz-option,
  .qz-chip,
  .qz-card,
  .qz-countdown-inner,
  .qz-gap,
  .qz-token,
  .qz-btn.is-steal,
  .qz-card-double,
  .qz-item-num,
  .qz-streak .qz-icon,
  .qz-timer-num,
  .qz-team-turn::before { animation: none !important; }
}
