/* quiz.css — quiz screen (prefix .qz-) */
.qz-root { pointer-events: none; }
.qz-root > * { pointer-events: auto; }
.qz-root > canvas, .qz-root .qz-fx { pointer-events: none; }
/* HUD chips: the plate is ::before and only it bumps / grows; the numbers are never scaled (stay sharp) */
.qz-pill, .qz-chip { position: absolute; isolation: isolate; border: 4px solid transparent; border-radius: 22px;
  display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--navy); transition: opacity .25s, color .2s; }
.qz-pill::before, .qz-chip::before { content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--chip, var(--cream)); border: 4px solid var(--navy); box-shadow: 0 3px 0 var(--navy); transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
/* white letters with the navy outline (outline-sm): navy letters under a navy outline smudged into a blur */
.qz-pill { left: 12px; top: 10px; width: 66px; height: 42px; font-size: 20px; color: #fff; }
.qz-chip { top: 8px; height: 46px; flex-direction: column; line-height: 1; gap: 2px; }
.qz-chip.solo { left: 90px; width: 150px; flex-direction: row; gap: 8px; font-size: 24px; }
.qz-chip.solo i { color: var(--magenta); font-style: normal; font-size: 24px; }
.qz-chip .nm { font-size: 14px; max-width: 108px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qz-chip .sc { font-size: 20px; }
.qz-chip.t0 { left: 86px; width: 116px; --chip: #ffe98a; }
.qz-chip.t1 { left: 208px; width: 116px; --chip: #b8f4fb; }
.qz-chip.active { z-index: 2; }
.qz-chip.active::before { transform: scale(1.1); box-shadow: 0 3px 0 var(--navy), 0 0 0 3px var(--yellow); }
.qz-chip.dim { opacity: .6; }
.qz-chip.dim::before { transform: scale(.92); }
.qz-chip.bump::before, .qz-pill.bump::before { animation: qzBump .35s cubic-bezier(.3,1.6,.5,1); }
.qz-chip.bump, .qz-pill.bump { color: var(--magenta); }
@keyframes qzBump { 0% { scale: 1; } 40% { scale: 1.25; } 100% { scale: 1; } }

.qz-timer { position: absolute; left: 12px; top: 62px; width: 372px; height: 14px; background: rgba(29,43,107,.55);
  border: 3px solid var(--navy); border-radius: 9px; overflow: hidden; }
.qz-timer b { display: block; height: 100%; width: 100%; background: var(--yellow); border-radius: 6px; }

.qz-hint { position: absolute; left: 12px; top: 86px; width: 52px; height: 52px; cursor: pointer; transition: opacity .2s; }
.qz-hint img { width: 52px; height: 52px; display: block; filter: drop-shadow(0 3px 0 var(--navy)); transition: transform .15s cubic-bezier(.3,1.6,.5,1); }
.qz-hint:hover > img, .qz-hint.focus > img { transform: scale(1.12); }
.qz-hint:active > img { transform: scale(.9); }
.qz-hint.off { opacity: .35; pointer-events: none; }
.qz-hint .bd { position: absolute; right: -10px; bottom: -6px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px;
  background: var(--magenta); border: 3px solid var(--navy); color: #fff; font-weight: 900; font-size: 14px; line-height: 18px;
  display: flex; align-items: center; justify-content: center; gap: 2px; white-space: nowrap; }
.qz-hint .bd img { width: 16px; height: 16px; filter: none; }

/* equipped flash card chip (solo) */
.qz-boost { position: absolute; left: 80px; top: 94px; height: 34px; max-width: 150px; padding: 0 10px 0 3px; display: flex; align-items: center; gap: 4px;
  background: var(--cream); border: 3px solid var(--navy); border-radius: 17px; box-shadow: 0 3px 0 var(--navy); font-weight: 900; font-size: 14px; color: var(--navy); white-space: nowrap; }
.qz-boost img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.qz-boost span { overflow: hidden; text-overflow: ellipsis; }
.qz-boost.spent { opacity: .5; filter: grayscale(.8); }

/* family skill button */
.qz-skill { position: absolute; left: 316px; top: 84px; width: 68px; height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 3px; background: linear-gradient(#ff7cc0, var(--magenta)); border: 4px solid var(--navy); border-radius: 18px; box-shadow: 0 4px 0 var(--navy); cursor: pointer;
  transition: filter .15s; animation: qzSkillPulse 1.2s ease-in-out infinite; }
.qz-skill img { width: 40px; height: 40px; object-fit: contain; pointer-events: none; transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.qz-skill span { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 900; color: #fff; -webkit-text-stroke: 3px var(--navy); paint-order: stroke fill; line-height: 18px; pointer-events: none; }
.qz-skill em { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-style: normal; font-size: 44px; color: #7fffd4; -webkit-text-stroke: 4px var(--navy); paint-order: stroke fill; }
.qz-skill:hover, .qz-skill.focus { border-color: var(--yellow); }
.qz-skill:hover img, .qz-skill.focus img { transform: scale(1.15); }
.qz-skill:active img { transform: scale(.88); }
.qz-skill.used { filter: grayscale(1) brightness(.8); animation: none; cursor: default; }
.qz-skill.used img, .qz-skill.used span { opacity: .4; }
.qz-skill.used em { display: flex; }
@keyframes qzSkillPulse { 0%, 100% { box-shadow: 0 4px 0 var(--navy), 0 0 0 rgba(255,210,63,0); } 50% { box-shadow: 0 4px 0 var(--navy), 0 0 14px var(--yellow); } }

/* pick modal */
.qz-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--navy); font-weight: 900; }
.qz-pick-title { font-size: 20px; line-height: 1.1; min-height: 44px; word-break: auto-phrase; text-wrap: balance; display: flex; align-items: center; justify-content: center; width: 100%; }
.qz-pick-grid { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; align-items: stretch; gap: 6px; width: 100%; flex: 1 0 auto; }
.qz-pick-card { width: 66px; min-height: 84px; height: auto; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
  background: var(--cream); border: 3px solid var(--navy); border-radius: 12px; box-shadow: 0 2px 0 var(--navy); }
.qz-pick-card img { width: 50px; height: 50px; object-fit: contain; pointer-events: none; transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
/* names wrap (never cut with "…") */
.qz-pick-card span { max-width: 100%; font-size: 12px; line-height: 13px; letter-spacing: -0.2px; white-space: normal; overflow-wrap: break-word; pointer-events: none; }
.qz-pick-card:hover img { transform: scale(1.1); }
.qz-pick-card.sel { background: #ffe98a; border-color: var(--magenta); box-shadow: 0 0 0 3px var(--yellow), 0 2px 0 var(--navy); }
.qz-pick-card.sel img { transform: scale(1.14); }
.qz-pick-info { width: 100%; min-height: 36px; padding: 4px 6px; font-size: 14px; line-height: 1.2; display: flex; align-items: center; justify-content: center; }
.qz-pick-btns { display: flex; gap: 14px; justify-content: center; width: 100%; padding: 4px 0 6px; }
.qz-pick-btns .btn { flex: 1; max-width: 140px; min-width: 0; font-size: 18px; padding: 8px 10px; }
.qz-pick.empty { justify-content: space-between; }
.qz-pick-pack { width: 96px; height: 96px; object-fit: contain; }
.qz-pick-msg { font-size: 18px; line-height: 1.3; padding: 0 4px; }

.qz-speaker { position: absolute; }
.qz-name { position: absolute; left: 0; width: 396px; top: 388px; text-align: center; font-size: 28px; line-height: 1.1; padding: 0 16px; }
.qz-fact { position: absolute; left: 28px; width: 340px; top: 424px; padding: 5px 10px; background: var(--cream); border: 3px solid var(--navy);
  border-radius: 14px; box-shadow: 0 3px 0 var(--navy); font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center; color: var(--navy); }
/* 「再聽一次」 speaker: sits inside the fact card's right end; the card keeps room for it */
.qz-fact.has-listen { min-height: 54px; padding: 5px 54px 5px 10px; display: flex; align-items: center; justify-content: center; }
.qz-listen { position: absolute; left: 318px; top: 429px; width: 44px; height: 44px; border-radius: 50%; padding: 0; z-index: 4;
  background: #ffd23f; border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qz-listen svg { width: 26px; height: 26px; pointer-events: none; }
.qz-listen:hover, .qz-listen.focus { background: #ffe57a; box-shadow: 0 3px 0 var(--navy), 0 0 0 3px #fff; }
.qz-listen.playing { background: #6fe3ff; }
.qz-listen.playing .w1 { animation: qzWave .7s ease-in-out infinite; }
.qz-listen.playing .w2 { animation: qzWave .7s ease-in-out .2s infinite; }
@keyframes qzWave { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.qz-collect { position: absolute; left: 98px; width: 200px; top: 480px; min-height: 44px; padding: 6px 12px; background: var(--magenta); color: #fff;
  border: 3px solid var(--navy); border-radius: 22px; box-shadow: 0 3px 0 var(--navy); font-weight: 900; font-size: 15px; text-align: center;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.qz-collect:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy); }

.qz-ch { position: absolute; width: 176px; height: 78px; border-width: 4px !important; padding: 12px 14px !important; border-radius: 28px; font-size: 20px; line-height: 1.05;
  text-align: center; -webkit-text-stroke: 3.5px var(--navy); }
.qz-ch > span { margin: 0; display: block; max-width: 100%; word-break: break-word; text-wrap: balance; }
.qz-ch.qz-locked { pointer-events: none; }
.qz-ch.qz-fade { opacity: 0; transform: translateY(14px) !important; transition: opacity .25s, transform .25s; }
/* right / wrong / dimmed: colour, glow, pulse and wobble go on the plate (::before); the answer text stays sharp */
.qz-ch.qz-correct { --b1: #c8ffd9; --b2: #3fe08a; --b3: #14b866; --b4: rgba(0, 110, 60, 0.4); }
.qz-ch.qz-correct::before { filter: brightness(1.08) drop-shadow(0 0 12px #7fffd4); animation: qzPulse .5s ease-in-out 3; }
.qz-ch.qz-wrong { --b1: #ffb3d6; --b2: #ff5fab; --b3: #e8307e; --b4: rgba(150, 0, 70, 0.4); }
.qz-ch.qz-wrong::before { filter: grayscale(.45) brightness(.85); animation: qzWobble .5s; }
.qz-ch.qz-dim { opacity: .45; pointer-events: none; }
.qz-ch.qz-dim::before { filter: grayscale(1) brightness(.7); }
.qz-ch.qz-dim::after { content: "✕"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 48px; color: var(--magenta); -webkit-text-stroke: 0; text-shadow: 0 2px 0 var(--navy); margin: 0; }
@keyframes qzPulse { 0%, 100% { scale: 1; } 50% { scale: 1.12; } }
@keyframes qzWobble { 0%, 100% { rotate: 0deg; } 20% { rotate: -7deg; } 40% { rotate: 6deg; } 60% { rotate: -4deg; } 80% { rotate: 3deg; } }

/* speech bubbles on the quiz screen (placeBubble in quiz.js): compact, tail to the side or none */
.ui-speech.qz-sp { padding: 6px 10px; font-size: 15px; line-height: 1.25; }
.ui-speech.qz-sp.side-l::after { left: -13px; right: auto; bottom: auto; top: calc(50% - 9px); border-right: none; border-top: none; border-left: 4px solid var(--navy); border-bottom: 4px solid var(--navy); }
.ui-speech.qz-sp.side-r::after { right: -13px; left: auto; bottom: auto; top: calc(50% - 9px); border-left: none; border-bottom: none; border-right: 4px solid var(--navy); border-top: 4px solid var(--navy); }
.ui-speech.qz-sp.top::after { display: none; }
/* first-round guide */
.qz-guide { position: absolute; left: 0; top: 0; width: 396px; height: 704px; z-index: 30; background: rgba(13, 24, 70, 0.32); cursor: pointer; transition: opacity 0.2s; }
.qz-guide.out { opacity: 0; pointer-events: none; }
.qz-gbox { position: absolute; left: 34px; top: 112px; width: 328px; box-sizing: border-box; padding: 16px 18px 14px; background: var(--cream); border: 4px solid var(--navy); border-radius: 24px; box-shadow: 0 5px 0 var(--navy); text-align: center; color: var(--navy); }
.qz-gtitle { font-size: 26px; line-height: 1.2; font-weight: 900; color: var(--magenta); overflow-wrap: anywhere; }
.qz-gtext { margin-top: 6px; font-size: 18px; line-height: 1.3; font-weight: 800; overflow-wrap: anywhere; }
.qz-gbar { margin: 12px auto 0; width: 200px; height: 8px; border-radius: 4px; background: rgba(29, 43, 107, 0.15); overflow: hidden; }
.qz-gbar b { display: block; height: 100%; width: 100%; background: var(--cyan); border-radius: 4px; }
.qz-gotto { position: absolute; left: 113px; top: 262px; pointer-events: none; }
.qz-garrow { position: absolute; left: 0; width: 396px; top: 452px; text-align: center; font-size: 34px; line-height: 40px; color: var(--yellow); -webkit-text-stroke: 3px var(--navy); paint-order: stroke fill; animation: qzArrow 0.7s ease-in-out infinite alternate; pointer-events: none; }
@keyframes qzArrow { from { transform: translateY(-6px); } to { transform: translateY(6px); } }
.qz-ghost { position: absolute; width: 176px; height: 78px; box-sizing: border-box; border: 4px dashed var(--cream); border-radius: 22px; background: rgba(255, 246, 224, 0.18); color: var(--cream); font-size: 34px; font-weight: 900; line-height: 70px; text-align: center; -webkit-text-stroke: 3px var(--navy); paint-order: stroke fill; animation: qzGhost 0.9s ease-in-out var(--d, 0ms) infinite alternate; pointer-events: none; }
@keyframes qzGhost { from { background: rgba(255, 246, 224, 0.12); } to { background: rgba(255, 210, 63, 0.38); } }
.qz-gskip { position: absolute; left: 20px; right: 20px; top: 604px; text-align: center; font-size: 15px; line-height: 1.3; color: var(--cream); font-weight: 800; pointer-events: none; }
.qz-next { position: absolute; left: 78px; top: 528px; width: 240px; height: 64px; font-size: 24px; }
/* floating score: centred on its point with fixed margins (no -50% translate) and only moved up, never scaled */
.qz-float { position: absolute; width: 220px; margin: -20px 0 0 -110px; text-align: center; font-size: 30px; pointer-events: none; animation: qzFloat 1s ease-out forwards; z-index: 5; }
@keyframes qzFloat { 0% { transform: translateY(12px); opacity: 0; } 25% { transform: translateY(-14px); opacity: 1; } 100% { transform: translateY(-80px); opacity: 0; } }
/* sticker: its plate (::before) is tilted and drops in; the words stay upright and unscaled */
.qz-sticker { position: absolute; isolation: isolate; padding: 10px 18px; font-size: 24px; font-weight: 900; color: var(--magenta); white-space: nowrap;
  animation: qzSticker .4s cubic-bezier(.3,1.6,.5,1) backwards; z-index: 4; }
.qz-sticker::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--yellow); border: 4px solid var(--navy); border-radius: 16px;
  box-shadow: 0 4px 0 var(--navy); transform: rotate(var(--r, -8deg)); }
.qz-sticker.out { animation: qzOut .3s forwards; }
@keyframes qzSticker { 0% { transform: translateY(-40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes qzOut { to { transform: translateY(-24px); opacity: 0; } }
.qz-polaroid { position: absolute; left: 88px; top: 150px; width: 220px; padding: 10px 10px 8px; background: var(--cream); border: 3px solid var(--navy); border-radius: 6px;
  box-shadow: 0 6px 0 rgba(29,43,107,.6); animation: qzPolar .45s cubic-bezier(.3,1.5,.5,1) backwards; text-align: center; z-index: 3; }
.qz-polaroid img, .qz-polaroid canvas { width: 198px; height: 190px; object-fit: cover; display: block; border: 2px solid var(--navy); background: #fff; }
.qz-polaroid div { margin-top: 6px; font-size: 18px; font-weight: 900; color: var(--navy); line-height: 1.1; min-height: 20px; }
@keyframes qzPolar { 0% { transform: translateY(60px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* question type tag (zoom / clue) */
.qz-tag { position: absolute; left: 128px; top: 130px; width: 140px; height: 28px; display: flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--cream); border: 3px solid var(--navy); border-radius: 14px; box-shadow: 0 3px 0 var(--navy); font-size: 14px; font-weight: 900;
  color: var(--navy); white-space: nowrap; pointer-events: none; z-index: 6; animation: qzSticker .35s cubic-bezier(.3,1.6,.5,1) backwards; }
.qz-tag img { width: 20px; height: 20px; object-fit: contain; }

/* magnifier: the window clips the picture, only the picture is transformed */
.qz-zoom { position: absolute; left: 83px; top: 147px; width: 230px; height: 230px; pointer-events: none; z-index: 2;
  animation: qzPolar .4s cubic-bezier(.3,1.5,.5,1) backwards; }
.qz-zoom-win { position: absolute; left: 0; top: 0; width: 230px; height: 230px; border-radius: 115px; overflow: hidden; background: rgba(255,246,224,.92);
  transition: left .65s cubic-bezier(.4,0,.2,1), top .65s cubic-bezier(.4,0,.2,1), width .65s cubic-bezier(.4,0,.2,1), height .65s cubic-bezier(.4,0,.2,1),
    border-radius .65s, background-color .65s; }
.qz-zoom-im { position: absolute; left: 0; top: 0; transform-origin: 0 0; background-size: 100% 100%; background-repeat: no-repeat;
  transition: transform .65s cubic-bezier(.4,0,.2,1); }
.qz-zoom-rim { position: absolute; left: 0; top: 0; width: 230px; height: 230px; border-radius: 115px; border: 9px solid var(--cream);
  box-shadow: 0 0 0 4px var(--navy), inset 0 0 0 3px var(--navy), 0 6px 0 4px rgba(29,43,107,.5); transition: opacity .5s; }
.qz-zoom-handle { position: absolute; left: 214px; top: 190px; width: 24px; height: 74px; background: var(--yellow); border: 4px solid var(--navy);
  border-radius: 12px; transform: rotate(-45deg); z-index: -1; transition: opacity .5s; }
.qz-zoom.open .qz-zoom-win { left: -20px; top: -20px; width: 270px; height: 270px; border-radius: 28px; background-color: rgba(255,246,224,0); }
.qz-zoom.open .qz-zoom-rim, .qz-zoom.open .qz-zoom-handle { opacity: 0; }
.qz-zoom.gone { opacity: 0; transition: opacity .3s; }

/* clue card */
.qz-clue { position: absolute; left: 58px; top: 150px; width: 280px; height: 222px; padding: 12px 16px 14px; display: flex; flex-direction: column; align-items: center;
  background: var(--cream); border: 4px solid var(--navy); border-radius: 24px; box-shadow: 0 6px 0 var(--navy); overflow: hidden; z-index: 2; pointer-events: none;
  animation: qzPolar .45s cubic-bezier(.3,1.5,.5,1) backwards; transition: transform .35s ease-in, opacity .35s; }
.qz-clue::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px;
  background: repeating-linear-gradient(135deg, var(--yellow) 0 8px, var(--cream) 8px 16px); border-bottom: 3px solid var(--navy); }
.qz-clue.out { transform: translateY(-60px); opacity: 0; }
.qz-clue-ic { width: 54px; height: 54px; object-fit: contain; margin-top: 8px; flex: none; }
.qz-clue-pack { position: absolute; right: 10px; top: 22px; width: 38px; height: 38px; object-fit: contain; }
.qz-clue-tx { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; width: 100%; max-width: 250px; font-weight: 900;
  font-size: 19px; line-height: 1.25; color: var(--navy); overflow-wrap: anywhere; word-break: normal; }

/* results */
.qz-res { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; color: var(--navy); font-weight: 900; }
.qz-res h2 { margin: 0; font-size: 28px; }
.qz-stars { display: flex; gap: 6px; height: 56px; }
.qz-star { font-size: 52px; line-height: 56px; color: #b9c3dc; -webkit-text-stroke: 3px var(--navy); paint-order: stroke fill; transition: color .1s; }
/* a star lands from above with a bounce: moved and faded, never scaled or turned, so its edge stays crisp */
.qz-star.on { color: var(--yellow); animation: qzStamp .4s cubic-bezier(.3,1.7,.5,1) backwards; }
@keyframes qzStamp { 0% { transform: translateY(-36px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.qz-res .big { font-size: 38px; color: var(--magenta); }
.qz-res .row { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 20px; }
.qz-res .row img { width: 26px; height: 26px; }
.qz-res .cards { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-height: 50px; overflow: hidden; }
.qz-res .cards img { width: 46px; height: 46px; object-fit: contain; background: var(--cream); border: 2px solid var(--navy); border-radius: 8px; animation: popIn .3s backwards; }
.qz-res .btns { display: flex; flex-direction: column; gap: 18px; align-items: center; padding: 4px 0 6px; }
.panel.fit .qz-res { gap: 16px; }
.qz-res .btns .btn { font-size: 18px; }
.qz-res .teams { display: flex; gap: 10px; }
.qz-res .tm { width: 118px; padding: 8px 4px; border: 3px solid var(--navy); border-radius: 14px; background: var(--cream); font-size: 16px; }
.qz-res .tm b { display: block; font-size: 28px; color: var(--magenta); }
.qz-res .tm.win { background: #ffe98a; border-color: var(--magenta); box-shadow: 0 0 0 3px var(--yellow), 0 0 16px var(--yellow); }
.qz-crown { position: relative; isolation: isolate; font-size: 22px; line-height: 1.25; padding: 10px 16px; color: #fff; word-break: auto-phrase; text-wrap: balance; animation: popIn .5s backwards; }
.qz-crown::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--magenta); border: 4px solid var(--navy); border-radius: 16px; transform: rotate(-3deg); }
