.screen--play { max-width: 1120px; margin: 0 auto; }
.play-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.play-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.play-title span { color: var(--ink-soft); font-size: 12px; font-weight: 800; white-space: nowrap; }
.play-title strong { overflow-wrap: anywhere; font-size: clamp(17px, 2.6vw, 24px); line-height: 1.3; }
.play-head > .pill { margin-left: auto; }
.play-hud {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .72fr));
  gap: 8px;
  margin-bottom: 12px;
}
.timer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 6px 12px;
  overflow: hidden;
  border: 1px solid #d9bf8d;
  border-radius: 12px;
  background: #fff9e9;
  box-shadow: var(--shadow-sm);
}
.timer__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, #f3d79a, #f7e8c4);
  transition: width .15s linear, background .2s ease;
  pointer-events: none;
}
.timer.is-low .timer__fill { background: linear-gradient(90deg, #e9a4ac, #f6d4d7); }
.timer.is-out .timer__fill { width: 0 !important; background: #e9c8cc; }
.timer__label, .timer__text { position: relative; z-index: 1; }
.timer__label { color: #6f551d; font-size: 11px; font-weight: 800; }
.timer__text { margin-left: auto; font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.timer__text::after { content: " 秒"; font-size: 10px; font-weight: 700; color: var(--ink-soft); }
.hud-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 240, .9);
  box-shadow: var(--shadow-sm);
}
.hud-stat__label { color: var(--ink-soft); font-size: 10.5px; line-height: 1.2; }
.hud-stat b { overflow-wrap: anywhere; font-size: 19px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.hud-stat--combo { border-color: #e2c37b; background: #fff8e3; }
.hud-stat--combo.is-hot { animation: combo-pop .35s ease; border-color: var(--mustard); background: #fff1c7; }
.dots { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 48px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 250, 240, .9); }
.dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e9ddc7; color: #6a6157; font-size: 10px; font-weight: 900; }
.dot.is-current { outline: 2px solid var(--zone); outline-offset: 2px; background: #fffaf0; color: var(--zone-deep); }
.dot.is-gold { background: var(--mustard); color: #4f3906; }
.dot.is-silver { background: #c8c1b4; color: #3f3932; }
.dot.is-bronze { background: #d6a27a; color: #4a2c16; }
.dot.is-timeout { background: #f0ced2; color: #8c1e2c; }

.play-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 14px;
  align-items: stretch;
}
.visual-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf0;
  box-shadow: var(--shadow);
}
.visual {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 240px;
  padding: 12px;
  background:
    radial-gradient(circle at 12% 18%, rgba(224, 165, 38, .12), transparent 42%),
    radial-gradient(circle at 88% 82%, var(--zone-soft), transparent 48%),
    #fffaf0;
}
.visual__figure { width: 100%; margin: 0; }
.visual__svg { display: block; width: 100%; height: auto; max-height: 44vh; margin: 0 auto; }
.visual__caption { margin-top: 3px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; text-align: center; }
.visual__mascot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; }
.mascot { display: inline-block; padding: 8px 14px; border: 2px dashed var(--zone); border-radius: 14px; background: var(--zone-soft); color: var(--zone-deep); font-weight: 900; }
.mascot--zhe { transform: rotate(2deg); }

.qa-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.question-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.question-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-index { color: var(--ink-soft); font-size: 11px; font-weight: 800; white-space: nowrap; }
.question-card__prompt { margin-top: 7px; font-size: clamp(17px, 2.4vw, 22px); font-weight: 900; line-height: 1.55; overflow-wrap: anywhere; }
.hint-box {
  padding: 10px 13px;
  border: 1px solid #e2c37b;
  border-left: 5px solid var(--mustard);
  border-radius: 10px;
  background: #fff7dd;
  color: #6b4a08;
  font-size: 13px;
  line-height: 1.6;
}
.hint-box strong { display: block; color: #5b3c04; font-size: 12px; }
.answer-area { min-width: 0; }
.question-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.question-actions--inner { margin-top: 10px; justify-content: flex-end; }
.question-actions .btn { flex: 0 1 auto; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 54px;
  padding: 9px 11px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 2px 0 #eadcc1;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.choice:hover { border-color: var(--zone); background: var(--zone-soft); transform: translateY(-1px); }
.choice:active { transform: translateY(1px); }
.choice__key {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 7px;
  background: var(--zone-soft);
  color: var(--zone-deep);
  font-size: 12px;
}
.choice__text { min-width: 0; overflow-wrap: anywhere; }
.choice.is-wrong { border-color: #c65d6b; background: #fbe7ea; animation: shake .3s ease; }
.choice.is-right { border-color: var(--good); background: var(--good-soft); box-shadow: 0 0 0 2px #b9dfc7; }
.choice.is-right .choice__key { background: var(--good); color: #fff; }
.choice:disabled { cursor: default; opacity: 1; }

.numpad-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 8px 14px;
  border: 2px solid #cdb389;
  border-radius: 12px;
  background: #fff9e9;
}
.numpad-display__label { color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.numpad-display__value { font-size: 29px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; }
.numpad-display__value.is-answer { color: var(--good); }
.numpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.numpad__key {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf7;
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 2px 0 #eadcc1;
}
.numpad__key:hover { background: var(--zone-soft); }
.numpad__key:active { transform: translateY(1px); box-shadow: none; }
.numpad__key--clear { font-size: 13px; background: #f5ece0; }
.numpad__key--submit { grid-column: span 3; background: var(--zone); color: #fff9e9; border-color: var(--zone-deep); font-size: 16px; }
.numpad__key--submit:disabled { background: #cdbfa9; border-color: #b5a58d; color: #6c6257; }

.order-wrap { min-width: 0; }
.order-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 44px;
  padding: 7px;
  border: 1px dashed #cdb389;
  border-radius: 10px;
  background: #fff9e9;
}
.order-slot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #e0cda9;
  border-radius: 7px;
  background: #fffdf7;
  font-size: 12.5px;
  line-height: 1.35;
}
.order-slot b { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; background: var(--zone); color: #fff; font-size: 10px; }
.order-slot--empty { border: 0; background: transparent; color: #6f655b; }
.order-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.order-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 46px;
  padding: 7px 9px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}
.order-item:hover { border-color: var(--zone); }
.order-item.is-picked { border-color: var(--zone); background: var(--zone-soft); }
.order-item__num { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: #e9ddc7; font-size: 11px; font-weight: 900; }
.order-item.is-picked .order-item__num { background: var(--zone); color: #fff; }
.order-item__text { min-width: 0; overflow-wrap: anywhere; }
.order-item:disabled { opacity: .85; }

.tap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.tap-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  padding: 7px 9px;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}
.tap-item:hover { border-color: var(--zone); }
.tap-item.is-picked { border-color: var(--zone); background: var(--zone-soft); box-shadow: inset 0 0 0 1px var(--zone); }
.tap-item.is-right { border-color: var(--good); background: var(--good-soft); }
.tap-item__swatch { width: 25px; height: 25px; flex: 0 0 25px; border: 1px solid #8b8176; border-radius: 7px; background: var(--swatch, #fff); }
.tap-item__text { min-width: 0; overflow-wrap: anywhere; }

.rhythm-wrap { min-width: 0; }
.rhythm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rhythm-help { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.rhythm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rhythm-cell {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0;
  min-height: 62px;
  padding: 4px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.rhythm-cell__num { color: #6f655b; font-size: 10px; font-weight: 800; }
.rhythm-cell__mark { color: #6f655b; font-size: 25px; font-weight: 900; line-height: 1; }
.rhythm-cell.is-on { border-color: var(--zone); background: var(--zone-soft); }
.rhythm-cell.is-on .rhythm-cell__mark { color: var(--zone-deep); }
.rhythm-cell.is-active { outline: 3px solid var(--mustard); outline-offset: 2px; transform: translateY(-2px); }
.rhythm-cell:disabled { opacity: .9; }

.match-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.match-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.match-col:first-child { padding-right: 2px; }
.match-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 6px 7px;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.match-item:hover { border-color: var(--zone); }
.match-item--left { background: #fff8e6; }
.match-item.is-selected { border-color: var(--mustard); box-shadow: 0 0 0 2px #f3dfae; background: #fff1c7; }
.match-item.is-locked { border-color: var(--good); background: var(--good-soft); color: #215c39; opacity: 1; }
.match-item.is-wrongpair { border-color: #c65d6b; background: #fbe7ea; animation: shake .3s ease; }
.match-item:disabled { cursor: default; opacity: .9; }
.match-item__text { min-width: 0; overflow-wrap: anywhere; }

.feedback {
  position: relative;
  margin-top: 12px;
  padding: 12px 15px;
  border: 1px solid #b9dfc7;
  border-left: 6px solid var(--good);
  border-radius: 12px;
  background: var(--good-soft);
  color: #1d5636;
  box-shadow: var(--shadow-sm);
  animation: feedback-in .25s ease both;
}
.feedback.is-bad { border-color: #e3b8bd; border-left-color: var(--bad); background: var(--bad-soft); color: #7b1c28; }
.feedback.is-warn { border-color: #e2c37b; border-left-color: var(--mustard); background: #fff7dd; color: #6b4a08; }
.feedback__title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 16px; font-weight: 900; }
.feedback__why { margin-top: 3px; font-size: 13px; line-height: 1.6; }
.feedback__why::before { content: "為什麼："; font-weight: 900; }
.feedback__score { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .72); font-size: 12px; }

.play-tip { min-height: 1.4em; margin-top: 7px; color: var(--ink-soft); font-size: 12px; text-align: center; }
.explain-answer { padding: 10px 12px; border-radius: 10px; background: var(--good-soft); color: #215c39; font-size: 15px; font-weight: 900; }
.explain-text { margin-top: 9px; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.unlock-dialog .dialog__body { text-align: center; font-size: 15px; }

@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes feedback-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes combo-pop { 0% { transform: scale(1); } 45% { transform: scale(1.08) rotate(-1deg); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

@media (max-width: 860px) {
  .play-stage { grid-template-columns: 1fr; }
  .visual { min-height: 190px; }
  .visual__svg { max-height: 36vh; }
  .numpad { gap: 4px; margin-top: 6px; }
  .numpad__key { min-height: 44px; }
  .numpad__key--submit { grid-column: span 1; }
  .numpad-display { min-height: 44px; padding: 5px 12px; }
}
@media (max-width: 620px) {
  .play-head { flex-wrap: nowrap; gap: 6px; margin-bottom: 6px; }
  .play-head > .pill { display: none; }
  .play-title { flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: 0; }
  .play-title span { font-size: 10px; line-height: 1.2; }
  .play-title strong { font-size: 15px; line-height: 1.25; }
  .play-head .btn--sm { flex: 0 0 auto; padding: 4px 10px; }
  .play-hud { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
  .timer { grid-column: span 2; min-height: 44px; padding: 4px 8px; }
  .hud-stat { min-height: 44px; padding: 3px 6px; }
  .hud-stat b { font-size: 15px; }
  .dots { grid-column: span 4; min-height: 22px; padding: 2px 6px; gap: 3px; }
  .dot { width: 16px; height: 16px; font-size: 8px; }
  .visual { min-height: 84px; padding: 6px; }
  .visual__svg { max-height: 84px; }
  .visual__caption { margin-top: 1px; font-size: 10px; line-height: 1.35; }
  .play-stage { gap: 8px; }
  .qa-panel { gap: 6px; }
  .question-card { order: 1; padding: 8px 10px; }
  .hint-box { order: 2; }
  .question-actions { order: 3; }
  .answer-area { order: 4; }
  .question-card__top .tag { display: none; }
  .question-card__prompt { margin-top: 3px; font-size: 15px; line-height: 1.35; }
  .choices, .order-list, .tap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .choice { min-height: 44px; padding: 6px 8px; font-size: 13px; }
  .order-list { margin-top: 5px; }
  .order-item { min-height: 44px; padding: 5px 7px; font-size: 12px; }
  .tap-item { min-height: 44px; padding: 5px 7px; font-size: 12px; }
  .match-item { font-size: 11.5px; padding: 4px; }
  .numpad { gap: 4px; margin-top: 5px; }
  .numpad__key { min-height: 44px; }
  .numpad__key--submit { grid-column: span 1; font-size: 14px; }
  .numpad-display { min-height: 44px; padding: 5px 10px; }
  .question-actions { gap: 6px; }
  .question-actions .btn { flex: 1 1 auto; }
  .question-actions--inner { margin-top: 6px; justify-content: stretch; }
  .question-actions--inner .btn { flex: 1 1 auto; }
}
@media (max-width: 380px) {
  .brand__text small { display: none; }
  .play-hud { margin-bottom: 4px; }
  .dots { display: none; }
  .visual { min-height: 52px; padding: 4px; }
  .visual__svg { max-height: 52px; }
  .visual__caption { display: none; }
  .play-stage { gap: 4px; }
  .qa-panel { gap: 2px; }
  .question-card { padding: 4px 8px; }
  .question-card__prompt { margin-top: 1px; line-height: 1.25; }
  .numpad { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin-top: 2px; }
  .numpad__key--submit { grid-column: span 1; }
  .numpad-display { min-height: 38px; padding: 3px 10px; }
  .play-tip { display: none; }
  .order-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rhythm-grid { gap: 4px; }
  .rhythm-cell { min-height: 52px; }
}
