/* ═══════════════════════════════════════════════════════════════
   VOLTLINGO v4 — QUIZ.CSS
   Quiz navigation · All 10 question types
   Answer options · Feedback panel
═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   1. QUIZ NAV (top bar)
────────────────────────────────────────────────────────────── */
.quiz-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; padding-top: calc(10px + var(--sat));
  border-bottom: 1px solid var(--line);
  background: rgba(6,7,10,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 100; flex-shrink: 0;
}
.quiz-prg-wrap { flex: 1; }
.quiz-prg-meta {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 8px; color: var(--t3);
  margin-bottom: 5px;
}
.quiz-prg-rail {
  height: 6px; background: var(--bg3); border-radius: 3px;
  overflow: hidden; border: 1px solid var(--line);
}
.quiz-prg-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--y3), var(--y));
  box-shadow: 0 0 8px rgba(255,214,10,.4);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
#q-xp-badge {
  background: rgba(255,214,10,.08); border: 1px solid rgba(255,214,10,.18);
  border-radius: 8px; padding: 2px 7px; color: var(--y);
}

/* Hearts */
.hearts-row { display: flex; gap: 3px; flex-shrink: 0; }
.hrt        { width: 17px; height: 15px; flex-shrink: 0; transition: all .3s cubic-bezier(.34,1.6,.64,1); }
.hrt.lost   { opacity: .12; transform: scale(.7); filter: grayscale(1); }
.hrt.losing { animation: hrtLose .45s ease both; }
@keyframes hrtLose {
  0%   { transform:scale(1); opacity:1; }
  30%  { transform:scale(1.4) rotate(-20deg); opacity:.6; }
  100% { transform:scale(.7); opacity:.12; }
}

/* ──────────────────────────────────────────────────────────────
   2. QUIZ BODY
────────────────────────────────────────────────────────────── */
.quiz-body {
  flex: 1; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 11px;
  overflow-y: auto;
}
.q-enter { animation: qEnter .3s cubic-bezier(.34,1.15,.64,1) both; }
.q-exit  { animation: qExit  .2s ease-in both; }
@keyframes qEnter { from { opacity:0; transform:translateX(18px) scale(.97); } }
@keyframes qExit  { to   { opacity:0; transform:translateX(-14px); } }

/* ──────────────────────────────────────────────────────────────
   3. TYPE BADGE
────────────────────────────────────────────────────────────── */
.type-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,214,10,.07); border: 1px solid rgba(255,214,10,.18);
  color: var(--y); padding: 5px 12px; border-radius: 20px;
  width: fit-content; font-family: var(--mono);
  font-size: 7.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  flex-shrink: 0;
}
.type-badge svg { width: 9px; height: 9px; flex-shrink: 0; }

/* ──────────────────────────────────────────────────────────────
   4. QUESTION CARD
────────────────────────────────────────────────────────────── */
.q-card {
  background: var(--bg1); border: 1px solid var(--ln2);
  border-radius: var(--r3); padding: 16px 18px; flex-shrink: 0;
}
.q-text { font-size: 18px; font-weight: 700; line-height: 1.55; letter-spacing: -.35px; }
.q-blank {
  display: inline-block; min-width: 110px; border-bottom: 2.5px solid var(--y);
  text-align: center; color: var(--y); font-weight: 800; padding: 0 6px;
  transition: all .2s; border-radius: 2px;
}
.q-blank.filled { background: var(--yg); border-radius: var(--r1) var(--r1) 2px 2px; }
.q-ctx {
  margin-top: 10px; font-family: var(--mono); font-size: 9.5px;
  color: var(--t2); line-height: 1.7;
  border-left: 2.5px solid var(--y3); padding-left: 10px;
}

/* ──────────────────────────────────────────────────────────────
   5. ANSWER OPTIONS
────────────────────────────────────────────────────────────── */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex-shrink: 0; }
.opts.single { grid-template-columns: 1fr; }

.opt {
  background: var(--bg1); border: 2px solid var(--ln2);
  border-radius: var(--r2); padding: 13px 11px;
  font-family: var(--syne); font-size: 13px; font-weight: 600;
  color: var(--t1); cursor: pointer; text-align: center; line-height: 1.4;
  transition: border-color .13s, background .13s, transform .1s;
  position: relative; overflow: hidden;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.opt:hover  { border-color: rgba(255,214,10,.3); background: var(--bg2); }
.opt:active { transform: scale(.96); }
.opt.sel    { border-color: var(--y); background: var(--yg); color: var(--y); box-shadow: 0 0 0 1px rgba(255,214,10,.15); }
.opt.ok     { border-color: var(--ok);  background: var(--okg); color: var(--ok);  animation: optOk .35s cubic-bezier(.34,1.56,.64,1); }
.opt.bad    { border-color: var(--err); background: var(--errg); color: var(--err); animation: shake .35s ease; }
.opt.disabled { pointer-events: none; cursor: default; }
@keyframes optOk { from { transform:scale(.97); } }

/* ──────────────────────────────────────────────────────────────
   6. AUDIO CARD (listen type)
────────────────────────────────────────────────────────────── */
.audio-card {
  background: var(--bg1); border: 2px solid var(--ln2);
  border-radius: var(--r4); padding: 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: border-color .2s, background .15s;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.audio-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 22% 50%, rgba(255,214,10,.04), transparent 55%);
  pointer-events: none;
}
.audio-card:hover   { border-color: rgba(255,214,10,.3); background: var(--bg2); }
.audio-card.playing { border-color: var(--y); background: var(--yg2); }
.play-btn {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: var(--yg); border: 2px solid rgba(255,214,10,.3);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: all .2s;
}
.audio-card:hover   .play-btn { background: rgba(255,214,10,.18); border-color: rgba(255,214,10,.5); }
.audio-card.playing .play-btn { border-color: var(--y); }
.play-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--y);
  opacity: 0; transition: opacity .2s;
}
.audio-card.playing .play-ring { opacity: 1; animation: spin .75s linear infinite; }
.play-btn svg { width: 20px; height: 20px; color: var(--y); }
.waveform    { display: flex; align-items: center; gap: 3px; height: 32px; margin-left: auto; }
.wav-bar     { width: 3.5px; background: linear-gradient(to top, rgba(255,214,10,.3), rgba(255,214,10,.8)); border-radius: 2px; transform: scaleY(.25); transform-origin: bottom; }
.audio-card.playing .wav-bar { animation: waveDance var(--dur,.45s) ease-in-out var(--del,0s) infinite alternate; }
@keyframes waveDance { from{transform:scaleY(.2)} to{transform:scaleY(1)} }
.audio-word { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.audio-hint { font-family: var(--mono); font-size: 10px; color: var(--t2); margin-top: 3px; }

/* ──────────────────────────────────────────────────────────────
   7. SVG SYMBOL CARD (visual match)
────────────────────────────────────────────────────────────── */
.sym-card {
  background: var(--bg1); border: 1px solid var(--ln2);
  border-radius: var(--r3); padding: 24px 20px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.sym-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,214,10,.035), transparent 65%);
  pointer-events: none;
}
.sym-card svg { width: 160px; height: 80px; overflow: visible; position: relative; z-index: 1; }

/* ──────────────────────────────────────────────────────────────
   8. WORD BANK (fill blank)
────────────────────────────────────────────────────────────── */
.word-bank { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.wchip {
  background: var(--bg3); border: 2px solid var(--ln2); border-radius: 10px;
  padding: 9px 14px; font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--t1); cursor: pointer; transition: all .13s; user-select: none;
}
.wchip:hover { border-color: rgba(255,214,10,.35); }
.wchip:active { transform: scale(.95); }
.wchip.sel  { border-color: var(--y); background: var(--yg); color: var(--y); animation: chipPop .22s cubic-bezier(.34,1.6,.64,1); }
.wchip.used { opacity: .18; pointer-events: none; transform: scale(.9); }
@keyframes chipPop { from { transform:scale(.75); } }

/* ──────────────────────────────────────────────────────────────
   9. ARRANGE WORDS
────────────────────────────────────────────────────────────── */
.arrange-answer {
  min-height: 50px; background: var(--bg2);
  border: 2px dashed var(--ln2); border-radius: var(--r2);
  padding: 9px; display: flex; flex-wrap: wrap; gap: 7px;
  align-items: center; transition: border-color .2s; flex-shrink: 0;
}
.arrange-answer:not(:empty) { border-color: rgba(255,214,10,.2); border-style: solid; }
.achip {
  background: var(--yg); border: 1.5px solid rgba(255,214,10,.3);
  border-radius: 9px; padding: 7px 13px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--y);
  cursor: pointer; animation: chipPop .2s cubic-bezier(.34,1.6,.64,1);
}
.achip:hover  { opacity: .75; }
.achip:active { transform: scale(.93); }
.source-chips { display: flex; flex-wrap: wrap; gap: 7px; flex-shrink: 0; }
.schip {
  background: var(--bg3); border: 2px solid var(--ln2); border-radius: 10px;
  padding: 8px 14px; font-family: var(--mono); font-size: 12px;
  font-weight: 700; color: var(--t1); cursor: pointer; transition: all .13s;
}
.schip:hover { border-color: rgba(255,214,10,.3); }
.schip.used  { opacity: .15; pointer-events: none; }

/* ──────────────────────────────────────────────────────────────
   10. SPEAKING TYPE
────────────────────────────────────────────────────────────── */
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; flex-shrink: 0; }
.mic-phrase { font-size: 24px; font-weight: 800; letter-spacing: -.6px; color: var(--y); text-align: center; line-height: 1.3; }
.mic-hint   { font-family: var(--mono); font-size: 10px; color: var(--t2); text-align: center; margin-top: -6px; }
.mic-btn {
  width: 86px; height: 86px; border-radius: 50%;
  background: var(--bg2); border: 2px solid var(--ln2);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: all .2s; cursor: pointer;
}
.mic-btn:hover { border-color: rgba(255,214,10,.4); }
.mic-btn:active { transform: scale(.94); }
.mic-btn.active {
  background: var(--yg); border-color: var(--y);
  animation: micPulse 1.1s ease-in-out infinite;
}
.mic-btn svg { width: 30px; height: 30px; color: var(--t1); transition: color .2s; }
.mic-btn.active svg { color: var(--y); }
@keyframes micPulse {
  0%,100% { box-shadow: 0 0 0 10px rgba(255,214,10,.10), 0 0 0 20px rgba(255,214,10,.05); }
  50%      { box-shadow: 0 0 0 16px rgba(255,214,10,.07), 0 0 0 30px rgba(255,214,10,.02); }
}
.mic-bars { display: flex; align-items: center; gap: 4px; height: 26px; width: 70px; justify-content: center; }
.mic-bar  { width: 3px; border-radius: 2px; background: var(--y); transform: scaleY(.2); transform-origin: bottom; }
.mic-btn.active ~ .mic-bars .mic-bar { animation: mBar var(--dur,.4s) ease-in-out var(--del,0s) infinite alternate; }
@keyframes mBar { from{transform:scaleY(.15)} to{transform:scaleY(1)} }
.mic-result {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  text-align: center; min-height: 40px; padding: 10px 18px;
  border-radius: var(--r2); background: var(--bg2); border: 1px solid var(--ln2);
  width: 100%; transition: all .2s; color: var(--t2);
}
.mic-result.heard { border-color: rgba(255,214,10,.3); color: var(--y); background: var(--yg2); }
.mic-result.ok    { border-color: rgba(34,197,94,.3);  color: var(--ok); }
.mic-result.bad   { border-color: rgba(239,68,68,.3);  color: var(--err); }

/* ──────────────────────────────────────────────────────────────
   11. STORY / DIALOG
────────────────────────────────────────────────────────────── */
.story-wrap {
  background: var(--bg1); border: 1px solid var(--ln2);
  border-radius: var(--r3); padding: 15px;
  display: flex; flex-direction: column; gap: 12px; flex-shrink: 0;
}
.story-scene { font-family: var(--mono); font-size: 8px; letter-spacing: 2px; color: var(--t3); text-transform: uppercase; margin-bottom: 2px; }
.brow   { display: flex; gap: 10px; align-items: flex-end; }
.brow.r { flex-direction: row-reverse; }
.bav {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.bav.a { background: var(--yg); border: 1px solid rgba(255,214,10,.25); color: var(--y); }
.bav.b { background: var(--okg); border: 1px solid rgba(34,197,94,.2); color: var(--ok); }
.bubble {
  max-width: 76%; padding: 10px 13px; font-size: 13px;
  font-weight: 600; line-height: 1.55;
}
.bubble.a { background: var(--bg3); border-radius: 4px 16px 16px 16px; }
.bubble.b { background: rgba(34,197,94,.07); border: 1px solid rgba(34,197,94,.15); border-radius: 16px 4px 16px 16px; }
.bubble-tts {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 5px;
  background: none; border: none; color: var(--y); cursor: pointer;
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  letter-spacing: .5px; opacity: .55; padding: 0; transition: opacity .15s;
}
.bubble-tts:hover { opacity: 1; }
.bubble-tts svg   { width: 11px; height: 11px; }

/* ──────────────────────────────────────────────────────────────
   12. MATCH PAIRS
────────────────────────────────────────────────────────────── */
.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex-shrink: 0; }
.match-col  { display: flex; flex-direction: column; gap: 7px; }
.mcard {
  background: var(--bg2); border: 2px solid var(--ln2); border-radius: var(--r2);
  padding: 12px 10px; text-align: center; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--t1);
  line-height: 1.4; transition: all .13s; user-select: none;
  min-height: 48px; display: flex; align-items: center; justify-content: center;
}
.mcard:hover   { border-color: rgba(255,214,10,.3); background: var(--bg3); }
.mcard:active  { transform: scale(.96); }
.mcard.sel     { border-color: var(--y); background: var(--yg); color: var(--y); }
.mcard.matched { border-color: var(--ok); background: var(--okg); color: var(--ok); pointer-events: none; animation: matchPop .35s cubic-bezier(.34,1.8,.64,1); }
.mcard.miss    { border-color: var(--err); background: var(--errg); animation: shake .35s ease; }
@keyframes matchPop { from { transform:scale(.85); } }

/* ──────────────────────────────────────────────────────────────
   13. TRUE / FALSE
────────────────────────────────────────────────────────────── */
.tf-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex-shrink: 0; }
.tf-card {
  background: var(--bg1); border: 2px solid var(--ln2); border-radius: var(--r3);
  padding: 20px 14px; display: flex; flex-direction: column; align-items: center;
  gap: 10px; cursor: pointer; transition: all .13s;
  font-size: 13px; font-weight: 800; letter-spacing: -.2px; user-select: none;
}
.tf-card:hover  { border-color: rgba(255,214,10,.25); background: var(--bg2); }
.tf-card:active { transform: scale(.96); }
.tf-card svg    { width: 36px; height: 36px; }
.tf-card.sel    { border-color: var(--y); background: var(--yg); }
.tf-card.ok     { border-color: var(--ok);  background: var(--okg);  color: var(--ok);  animation: optOk .35s cubic-bezier(.34,1.56,.64,1); }
.tf-card.bad    { border-color: var(--err); background: var(--errg); color: var(--err); animation: shake .35s ease; }

/* ──────────────────────────────────────────────────────────────
   14. SUBMIT BUTTON
────────────────────────────────────────────────────────────── */
.btn-submit {
  background: var(--y); color: var(--bg); border: none;
  border-radius: var(--r2); padding: 15px 16px;
  font-family: var(--syne); font-size: 15px; font-weight: 800;
  width: 100%; cursor: pointer; letter-spacing: -.3px;
  transition: all .15s; box-shadow: 0 4px 20px rgba(255,214,10,.2);
  position: relative; overflow: hidden; flex-shrink: 0;
}
.btn-submit:hover:not(:disabled)  { box-shadow: 0 6px 28px rgba(255,214,10,.35); transform: translateY(-1px); }
.btn-submit:active:not(:disabled) { transform: scale(.98); opacity: .9; }
.btn-submit:disabled               { opacity: .22; cursor: default; box-shadow: none; transform: none; }
.btn-submit.skip {
  background: var(--bg2); color: var(--t2);
  border: 1.5px solid var(--ln2); font-family: var(--mono);
  font-size: 12px; box-shadow: none;
}
.btn-submit.skip:hover:not(:disabled) { border-color: var(--ln3); color: var(--t1); box-shadow: none; transform: none; }

/* ──────────────────────────────────────────────────────────────
   15. QUIZ BODY SHAKE
────────────────────────────────────────────────────────────── */
.quiz-body.shake { animation: shake .38s ease; }

/* ──────────────────────────────────────────────────────────────
   16. RESPONSIVE
────────────────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .q-text    { font-size: 16px; }
  .opt       { font-size: 12px; padding: 11px 9px; }
  .audio-word{ font-size: 19px; }
  .mic-phrase{ font-size: 20px; }
}
@media (min-width: 480px) {
  .quiz-body { padding: 16px 24px; }
  .sym-card svg { width: 200px; height: 100px; }
}
