/* ============================================================
   答題畫面：HUD、提示圖、題目、五種互動、解說
   ============================================================ */
.play-head {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 2px 0 8px;
}
.play-head__title { min-width: 0; display: grid; gap: 1px; }
.play-head__title .eyebrow { font-size: 11px; }
.play-head__title strong { font-size: clamp(18px, 2.6vw, 25px); line-height: 1.25; overflow-wrap: anywhere; }
.play-head__score {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid rgba(255, 200, 87, 0.38); background: rgba(255, 200, 87, 0.1); color: var(--gold-2); font-weight: 900;
}
.play-head__score span { font-size: 13px; }
.play-head__score b { font-size: 20px; color: #fff; }

.hud {
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(12, 18, 46, 0.7); margin-bottom: 12px;
}
.timer-row { display: flex; align-items: center; gap: 10px; }
.timer {
  position: relative; flex: 1 1 auto; height: 14px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.12);
}
.timer__fill { height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--cyan)); transition: width 0.12s linear, background 0.2s ease; }
.timer.is-low .timer__fill { background: linear-gradient(90deg, #ff9f6e, var(--danger)); }
.timer.is-low { animation: timer-pulse 0.8s ease-in-out infinite; }
.timer__text { min-width: 50px; text-align: right; font-size: 13px; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hud__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.dots { display: flex; gap: 4px; margin-left: auto; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.2); }
.dot.is-now { background: var(--cyan); box-shadow: 0 0 0 3px rgba(94, 231, 255, 0.18); }
.dot.is-ok { background: var(--mint); }
.dot.is-miss { background: var(--pink); }

.play-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.visual-panel {
  position: sticky; top: calc(var(--sysbar-h) + var(--safe-top) + 14px);
  min-width: 0; padding: 10px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(10, 16, 42, 0.58);
}
.visual { width: 100%; border-radius: 12px; overflow: hidden; background: #fbf9ff; }
.visual svg { display: block; width: 100%; height: auto; }
.visual.is-correct { animation: correct-glow 0.7s ease; }
.visual.is-wrong { animation: wrong-glow 0.5s ease; }

.qa-panel { min-width: 0; }
.question-card {
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(18, 27, 66, 0.92); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.question-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.q-index { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.question-card__prompt { font-size: clamp(17px, 2.1vw, 22px); line-height: 1.55; font-weight: 800; overflow-wrap: anywhere; letter-spacing: 0.01em; }
.question-card.is-correct { border-color: rgba(78, 225, 176, 0.55); }
.question-card.is-wrong { border-color: rgba(255, 122, 138, 0.5); }
.question-card.is-shaking { animation: shake 0.4s ease; }

.question-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 9px 0 2px; }
.answer-area { margin-top: 8px; }
.answer-instruction { color: var(--muted); font-size: 12.5px; margin-bottom: 7px; }
.options { display: grid; grid-template-columns: 1fr; gap: 7px; }
.options--multi { grid-template-columns: 1fr; }
.option {
  width: 100%; min-height: 46px; display: flex; align-items: center; gap: 9px; text-align: left;
  padding: 8px 11px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055); color: var(--ink); font-weight: 700; font-size: 14px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease; overflow-wrap: anywhere;
}
.option:hover { background: rgba(255, 255, 255, 0.11); border-color: var(--line-strong); }
.option:active { transform: scale(0.995); }
.option__key, .option__check, .option__num {
  flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px;
  background: rgba(94, 231, 255, 0.12); border: 1px solid rgba(94, 231, 255, 0.28); color: #d7fbff; font-size: 12px; font-weight: 900;
}
.option__label { min-width: 0; }
.option.is-picked { background: rgba(94, 231, 255, 0.14); border-color: rgba(94, 231, 255, 0.6); }
.option.is-picked .option__check { background: var(--cyan); color: #082032; }
.option.is-wrong { border-color: rgba(255, 122, 138, 0.7); background: rgba(255, 122, 138, 0.12); }
.option:disabled { opacity: 0.55; }
.submit-row { display: flex; justify-content: flex-end; margin-top: 9px; }

.options--order { grid-template-columns: 1fr; }
.order-seq {
  min-height: 46px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px;
  padding: 7px; border-radius: 10px; border: 1px dashed var(--line-strong); background: rgba(0, 0, 0, 0.12);
}
.order-seq__empty { color: var(--muted); font-size: 12.5px; padding: 4px; }
.seq-chip {
  min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px;
  border-radius: 8px; border: 1px solid rgba(255, 200, 87, 0.35); background: rgba(255, 200, 87, 0.12);
  color: #fff3cd; font-size: 12.5px; font-weight: 700; max-width: 100%; overflow-wrap: anywhere;
}
.seq-chip span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #1b1830; font-size: 11px; font-weight: 900; }
.seq-chip b { color: var(--gold-2); }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.match-col { min-width: 0; }
.match-col h3 { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 5px; }
.match-item {
  width: 100%; min-height: 46px; margin-bottom: 6px; padding: 7px 9px; text-align: left;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.055);
  color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere;
}
.match-item:hover { background: rgba(255, 255, 255, 0.1); }
.match-item.is-selected { border-color: var(--cyan); background: rgba(94, 231, 255, 0.16); }
.match-item.is-paired { border-color: rgba(78, 225, 176, 0.45); background: rgba(78, 225, 176, 0.1); }
.match-pairs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 34px; }
.pair-chip {
  min-height: 44px; padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(78, 225, 176, 0.3);
  background: rgba(78, 225, 176, 0.08); color: #d9fff2; font-size: 12px; line-height: 1.4; max-width: 100%; overflow-wrap: anywhere;
}
.pair-chip span { color: var(--mint); }
.pair-chip b { color: var(--gold-2); }

.options--tap { grid-template-columns: 1fr; }
.option--tap { justify-content: center; text-align: center; }

.explain-box { margin-top: 10px; }
.play-foot { display: flex; justify-content: flex-start; margin-top: 14px; }

.hotspot { cursor: pointer; }
.hotspot circle:first-of-type { transition: fill 0.15s ease, stroke 0.15s ease; }
.hotspot:hover circle:first-of-type { fill: rgba(255, 200, 87, 0.5); stroke: var(--gold); }
.hotspot:focus-visible circle:first-of-type { stroke: var(--cyan); stroke-width: 5; }

@media (min-width: 1000px) {
  .options { grid-template-columns: 1fr 1fr; }
  .options--order, .options--tap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .play-grid { grid-template-columns: 1fr; }
  .visual-panel { position: static; }
  .visual svg { max-height: 260px; }
}
@media (max-width: 600px) {
  .play-head { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .play-head__score b { font-size: 17px; }
  .hud { padding: 8px 10px; }
  .dots { margin-left: 0; }
  .visual-panel { padding: 7px; }
  .visual svg { max-height: 230px; }
  .question-card { padding: 10px 12px; }
  .question-actions .btn { flex: 1 1 auto; }
  .match-item { font-size: 12px; min-height: 48px; }
  .seq-chip { font-size: 12px; }
  .option { min-height: 48px; font-size: 13.5px; }
}
@media (max-width: 390px) {
  .match-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .match-item { padding: 6px; }
  .visual svg { max-height: 210px; }
}
