/* ============================================================
   遊戲進行中：HUD、插圖、題目、四種作答介面
   ============================================================ */
.play-shell { max-width: 1180px; margin: 0 auto; }
.play-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
}
.play-head .text-btn { flex: none; }
.play-head__title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.play-head__title span { color: var(--gold-2); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.play-head__title strong {
  color: #fff8ea;
  font-family: var(--serif);
  font-size: clamp(17px, 2.4vw, 24px);
  line-height: 1.25;
  letter-spacing: .03em;
  overflow-wrap: anywhere;
}
.play-counter {
  flex: none;
  padding: 5px 10px;
  border: 1px solid rgba(233, 196, 106, .32);
  border-radius: 999px;
  background: rgba(251, 246, 236, .07);
  color: #e7dced;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.play-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  padding: 8px;
  border: 1px solid rgba(233, 196, 106, .26);
  border-radius: 16px;
  background: rgba(25, 13, 39, .5);
  backdrop-filter: blur(8px);
}
.timer { flex: 1 1 230px; min-width: 170px; padding: 3px 6px; }
.timer__top { display: flex; align-items: baseline; gap: 5px; color: #d7cce3; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.timer__top strong { color: var(--gold-2); font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; }
.timer__track { height: 7px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: rgba(251, 246, 236, .17); }
.timer__track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e9c46a, #f6dfa6); transition: width .1s linear, background .2s ease; }
.timer.is-warning .timer__top strong { color: #ffc078; }
.timer.is-warning .timer__track span { background: linear-gradient(90deg, #e8a15c, #ffc078); }
.timer.is-critical .timer__top strong { color: #ff9c9c; }
.timer.is-critical .timer__track span { background: linear-gradient(90deg, #c96a7b, #ff9c9c); }
.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 67px;
  min-height: 42px;
  padding: 3px 9px;
  border: 1px solid rgba(251, 246, 236, .16);
  border-radius: 10px;
  background: rgba(251, 246, 236, .07);
}
.hud-stat span { color: #b9aecb; font-size: 9px; letter-spacing: .08em; line-height: 1.3; }
.hud-stat strong { color: #fff8ea; font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dots { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-left: auto; padding: 0 3px; }
.dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(251, 246, 236, .28);
  border-radius: 50%;
  background: rgba(251, 246, 236, .08);
  color: #c9bdd6;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.dot.is-current { border-color: var(--gold-2); background: var(--gold-2); color: var(--plum); }
.dot.is-correct { border-color: #7fc08f; background: #4e9666; color: #fff; }
.dot.is-wrong { border-color: var(--rose); background: var(--rose); color: #fff; }
.dot.is-timeout { border-color: #e8a15c; background: #b97639; color: #fff; }

.play-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 15px;
  align-items: start;
}
.visual-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(233, 196, 106, .42);
  border-radius: 19px;
  background: rgba(20, 11, 32, .54);
  box-shadow: 0 16px 44px rgba(10, 5, 18, .22);
}
.visual-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 8px;
  color: var(--gold-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
}
.visual-card__head span:last-child { color: #b9aecb; font-weight: 600; letter-spacing: .04em; }
.play-visual {
  overflow: hidden;
  border-radius: 13px;
  background: #2a1d42;
}
.play-visual svg { display: block; width: 100%; height: auto; max-height: 47dvh; }
.play-visual .spot { cursor: pointer; }
.play-visual .spot-hit {
  fill: rgba(255, 255, 255, 0);
  stroke: rgba(246, 223, 166, 0);
  stroke-width: 2;
  pointer-events: none;
  transition: fill .16s ease, stroke .16s ease;
}
.play-visual .spot-touch { fill: rgba(0, 0, 0, 0); }
.play-visual .spot:hover .spot-hit,
.play-visual .spot:focus .spot-hit,
.play-visual .spot:focus-visible .spot-hit {
  fill: rgba(246, 223, 166, .12);
  stroke: #f6dfa6;
  stroke-width: 3;
}
.play-visual .spot.is-wrong .spot-hit { fill: rgba(201, 106, 123, .24); stroke: #e08a9b; stroke-width: 4; }
.play-visual .spot.is-correct .spot-hit { fill: rgba(111, 155, 106, .24); stroke: #9bd3a6; stroke-width: 4; }
.tap-instruction {
  margin: 7px 4px 2px;
  color: #f0dfb9;
  font-size: 11.5px;
  line-height: 1.5;
}
.visual-card.is-wrong { animation: shake .4s ease; }
.visual-card.is-correct { animation: glow-correct .65s ease; }
.visual-card.is-timeout { border-color: #d89a5e; }

.qa-card {
  min-width: 0;
  padding: clamp(15px, 2.2vw, 23px);
  border: 1px solid rgba(233, 196, 106, .65);
  border-radius: 21px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 44px rgba(10, 5, 18, .24);
}
.q-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f3e5cc;
  color: #86592a;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
}
.q-type { color: var(--ink-3); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; }
.q-prompt {
  margin: 8px 0 11px;
  color: #2f2638;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.question-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; }
.qa-card .mini-btn { border-color: #ddcfb9; background: #faf3e6; color: #6e4a24; }
.qa-card .mini-btn:hover { background: #f1e4cf; }
.hint-box {
  margin: 7px 0;
  padding: 9px 11px;
  border: 1px dashed #d2b47a;
  border-radius: 10px;
  background: #fbf1db;
  color: #73521f;
  font-size: 12.5px;
  line-height: 1.7;
}
.feedback { min-width: 0; }
.feedback-bubble {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 8px 0;
  padding: 9px 11px;
  border: 1px solid #e2d5c2;
  border-radius: 12px;
  background: #faf4e9;
  color: #4d4256;
  font-size: 12.5px;
  line-height: 1.65;
  animation: feedback-in .22s ease both;
}
.feedback-bubble.is-correct { border-color: #a9d0b2; background: #eef8ef; color: #2f6345; }
.feedback-bubble.is-wrong { border-color: #e4b3ad; background: #fbecea; color: #7d3b37; }
.feedback-bubble.is-timeout { border-color: #e3c08f; background: #fbf2e2; color: #7a5521; }
.feedback-bubble.is-solution { border-color: #d8c6a9; background: #f7efe1; color: #69553c; }
.feedback__icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: none;
  border-radius: 50%;
  background: rgba(123, 92, 214, .12);
  color: #6b4bbd;
  font-size: 12px;
  font-weight: 900;
}
.feedback-bubble.is-correct .feedback__icon { background: #cfe9d4; color: #2f6f4b; }
.feedback-bubble.is-wrong .feedback__icon { background: #f0cbc7; color: #963f3a; }
.feedback-bubble.is-timeout .feedback__icon { background: #f0d9b5; color: #8a5a20; }
.feedback__copy { min-width: 0; }
.feedback__copy strong { display: block; font-size: 12.5px; line-height: 1.45; }
.feedback__copy > span { display: block; margin-top: 1px; overflow-wrap: anywhere; }
.solution-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 5px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: #7c571f;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.answer-area { min-width: 0; margin-top: 5px; }
.choice-btn,
.match-btn,
.order-item,
.answer-tools .btn,
.tap-status,
.feedback-bubble { scroll-margin-bottom: calc(var(--footer-h) + 12px); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.choice-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 51px;
  padding: 8px 10px;
  border: 1px solid #dfd3c1;
  border-radius: 11px;
  background: #fff;
  color: #37303f;
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.choice-btn:hover { border-color: #a78bd8; background: #faf6ff; transform: translateY(-1px); }
.choice-btn.is-selected { border-color: var(--violet); background: #f1ebff; }
.choice-btn.is-wrong { border-color: #cf7c7c; background: #fbecea; color: #7d3b37; }
.choice-btn.is-correct { border-color: #6aa87b; background: #eef8ef; color: #2f6345; }
.choice-letter {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: none;
  border-radius: 7px;
  background: #f1e5d1;
  color: #8a5c2b;
  font-size: 10.5px;
  font-weight: 900;
}
.choice-btn.is-selected .choice-letter { background: var(--violet); color: #fff; }
.choice-btn.is-correct .choice-letter { background: #6aa87b; color: #fff; }
.choice-btn.is-wrong .choice-letter { background: #cf7c7c; color: #fff; }
.choice-text { min-width: 0; overflow-wrap: anywhere; }

.tap-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 11px;
  border: 1px dashed #d6c4a7;
  border-radius: 11px;
  background: #faf4e8;
  color: #6b5b47;
  font-size: 12px;
  line-height: 1.55;
}
.tap-status__icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: none;
  border-radius: 50%;
  background: #efe2cd;
  color: #8a5c2b;
  font-size: 12px;
  font-weight: 900;
}
.tap-status.is-wrong { border-color: #d9a29b; background: #fbecea; color: #83433d; }
.tap-status.is-correct { border-color: #a9d0b2; background: #eef8ef; color: #2f6345; }

.answer-tools { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.qa-card .btn--ghost { border-color: #d9cbb6; background: #fff; color: var(--ink); }
.qa-card .btn--ghost:hover { background: #f5ecdd; }
.qa-card .btn--primary { color: var(--plum); }

.match-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.match-col { min-width: 0; }
.match-title { margin-bottom: 3px; color: var(--ink-3); font-size: 9.5px; font-weight: 800; letter-spacing: .08em; }
.match-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  min-height: 47px;
  margin-bottom: 6px;
  padding: 7px 9px;
  border: 1px solid #ded2c0;
  border-radius: 9px;
  background: #fff;
  color: #3a3242;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.match-btn:hover { border-color: #ab8fda; background: #faf6ff; }
.match-label { min-width: 0; overflow-wrap: anywhere; }
.match-pick { min-width: 0; max-width: 55%; color: #7b5cd6; font-size: 9px; font-weight: 700; line-height: 1.35; text-align: right; overflow-wrap: anywhere; }
.match-btn.is-active { border-color: var(--violet); background: #f1ebff; }
.match-btn.is-used { border-color: #cdbcec; background: #f8f3ff; }
.match-btn.is-wrong { border-color: #d18a84; background: #fbecea; }
.match-btn.is-correct { border-color: #75ae85; background: #eef8ef; }
.match-btn.is-nudge { animation: nudge .35s ease; }

.order-pool { display: grid; gap: 6px; }
.order-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid #ded2c0;
  border-radius: 9px;
  background: #fff;
  color: #3a3242;
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.order-item:hover { border-color: #ab8fda; background: #faf6ff; }
.order-item.is-picked { border-color: #9c7dd4; background: #f2ecff; }
.order-item.is-wrong { border-color: #d18a84; background: #fbecea; }
.order-item.is-correct { border-color: #75ae85; background: #eef8ef; }
.order-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: #f1e5d1;
  color: #8a5c2b;
  font-size: 10px;
  font-weight: 900;
}
.order-item.is-picked .order-num { background: var(--violet); color: #fff; }
.order-label { min-width: 0; overflow-wrap: anywhere; }
.order-preview {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f7efe2;
  color: #675846;
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.order-preview b { color: #493b5c; }
.order-preview.is-wrong { background: #fbecea; color: #7d3b37; }
.order-preview.is-correct { background: #eef8ef; color: #2f6345; }
.answer-area.is-locked .choice-btn,
.answer-area.is-locked .match-btn,
.answer-area.is-locked .order-item { cursor: default; }
.answer-area.is-locked .choice-btn:hover,
.answer-area.is-locked .match-btn:hover,
.answer-area.is-locked .order-item:hover { transform: none; }

@media (max-width: 900px) {
  .play-stage { grid-template-columns: 1fr; gap: 11px; }
  .play-visual svg { max-height: 235px; }
  .visual-card { padding: 7px; }
  .qa-card { padding: 14px; }
}
@media (max-width: 560px) {
  .play-head { gap: 7px; margin-bottom: 7px; }
  .play-head .text-btn { font-size: 12px; }
  .play-counter { font-size: 9.5px; padding: 4px 7px; }
  .play-hud { flex-wrap: nowrap; gap: 5px; padding: 6px; margin-bottom: 9px; }
  .timer { flex: 1 1 92px; min-width: 0; padding: 1px 3px; }
  .hud-stat { flex: 0 0 52px; min-width: 0; min-height: 38px; padding: 3px 5px; }
  .hud-stat span { font-size: 8px; }
  .hud-stat strong { font-size: 15px; }
  .dots { flex: 0 0 auto; justify-content: flex-end; gap: 3px; margin-left: auto; padding: 0; }
  .dot { width: 14px; height: 14px; font-size: 8px; }
  .play-visual svg { max-height: 195px; }
  .play-stage[data-qtype="choice"] .play-visual svg { max-height: 120px; }
  .play-stage[data-qtype="match"] .qa-card,
  .play-stage[data-qtype="order"] .qa-card { order: 1; }
  .play-stage[data-qtype="match"] .visual-card,
  .play-stage[data-qtype="order"] .visual-card { order: 2; }
  .order-pool { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-card__head { font-size: 9px; padding-bottom: 6px; }
  .q-prompt { font-size: 17px; margin: 6px 0 9px; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .choice-btn { min-height: 46px; font-size: 12.5px; padding: 7px 8px; }
  .match-btn { font-size: 11px; min-height: 45px; padding: 6px 7px; }
  .match-pick { font-size: 8px; max-width: 52%; }
  .order-item { font-size: 11.5px; min-height: 44px; }
  .feedback-bubble { font-size: 11.5px; padding: 8px 9px; }
  .feedback__copy strong { font-size: 11.5px; }
  .mini-btn { min-height: 44px; font-size: 12px; }
  .answer-tools .btn { flex: 1 1 auto; }
  .solution-link { min-height: 44px; }
}
@media (max-width: 380px) {
  .play-level-name { font-size: 16px; }
  .play-visual svg { max-height: 175px; }
  .play-visual svg { max-height: 145px; }
  .play-stage[data-qtype="choice"] .play-visual svg { max-height: 82px; }
  .timer { padding: 0 3px; }
  .timer__top strong { font-size: 18px; }
  .timer__track { height: 6px; margin-top: 3px; }
  .hud-stat { flex-basis: 48px; min-height: 36px; padding: 2px 4px; }
  .hud-stat strong { font-size: 14px; }
  .dot { width: 12px; height: 12px; font-size: 7px; }
  .qa-card { padding: 11px; }
  .q-prompt { font-size: 16px; }
  .match-wrap { gap: 5px; }
  .match-btn { font-size: 10.5px; }
  .choice-btn { font-size: 12px; padding: 6px 7px; }
  .order-item { font-size: 11px; }
}
