/* 关卡播放器与各题型 */

.player { display: flex; flex-direction: column; height: 100dvh; }
.player-bare { justify-content: center; }
.player-top {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 12px 8px 6px;
}
.pbar { flex: 1; height: 16px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pbar-fill {
  width: 0; height: 100%; border-radius: 999px; min-width: 16px;
  background: linear-gradient(180deg, #FFCF5C, var(--sun));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
  transition: width .45s cubic-bezier(.3, 1.4, .5, 1);
}
.hearts { flex: none; display: flex; gap: 1px; font-size: 17px; line-height: 1; }
.heart { display: inline-block; transition: filter .3s, opacity .3s; }
.heart.is-lost { filter: grayscale(1); opacity: .28; }
.heart.just-lost { animation: heart-break .55s; }
@keyframes heart-break { 0% { transform: scale(1.7) rotate(-12deg); filter: none; opacity: 1; } 60% { transform: scale(.8) rotate(8deg); } 100% { transform: none; } }
.mode-tag { flex: none; padding: 4px 12px; border-radius: 999px; background: var(--sun-soft); color: var(--sun-deep); font-size: 13px; font-weight: 800; }
.retry-tag { flex: none; margin: 0 16px 4px; padding: 6px 12px; border-radius: 10px; background: var(--sun-soft); color: var(--sun-deep); font-size: 13px; font-weight: 700; }
.correction-tag { flex: none; margin: 0 16px 4px; padding: 6px 12px; border-radius: 10px; background: var(--lingon-soft); color: var(--lingon-deep); font-size: 13px; font-weight: 700; }

.player-stage { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 8px 16px 20px; }
.player-stage.is-shaking { animation: shake-x .4s; }
.player-stage > .ex { animation: rise .28s both; }

.player-foot {
  flex: none; display: grid; gap: 12px;
  padding: 14px 16px calc(16px + var(--safe-b));
  border-top: 2px solid var(--line); background: var(--bg);
}
.player-foot.is-ok { background: var(--ok-soft); border-top-color: transparent; }
.player-foot.is-bad { background: var(--lingon-soft); border-top-color: transparent; }
.fb { animation: rise .22s both; }
.fb-title { display: block; font-size: 20px; font-weight: 900; }
.is-ok .fb-title { color: var(--ok-deep); }
.is-bad .fb-title { color: var(--lingon-deep); }
.fb-text { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.fb-title.is-why { font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.fb-title .why-mark { color: var(--lingon); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) {
  .is-ok .fb-title { color: var(--ok); }
  .is-bad .fb-title { color: var(--lingon); }
}

/* —— 题目通用 —— */
.ex { display: grid; gap: 16px; align-content: start; }
.ex-title { font-size: 21px; font-weight: 900; line-height: 1.3; }
.ex-prompt {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px;
  min-height: 112px; padding: 18px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 2px solid var(--line);
}
.ex-word { font-size: 40px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; text-align: center; }
.ex-word-zh { font-size: 32px; font-family: var(--font); }
.ex-hint { color: var(--muted); font-size: 14px; }

.opts { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: left;
  box-shadow: 0 4px 0 var(--line); font-size: 18px; font-weight: 700;
  transition: transform .08s, box-shadow .08s, border-color .12s, background .12s;
}
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt-key {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  border: 2px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 800; font-family: var(--font-round);
}
.opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt.is-selected { border-color: var(--btn); background: var(--brand-soft); box-shadow: 0 4px 0 var(--btn); }
.opt.is-selected .opt-key { border-color: var(--btn); background: var(--btn); color: #fff; }
.opt.is-right { border-color: #0E9C8B; background: var(--ok-soft); box-shadow: 0 4px 0 #0E9C8B; animation: pop .35s; }
.opt.is-right .opt-key { border-color: #0E9C8B; background: #0E9C8B; color: #fff; }
.opt.is-wrong { border-color: #D93A48; background: var(--lingon-soft); box-shadow: 0 4px 0 #D93A48; }
.opt.is-wrong .opt-key { border-color: #D93A48; background: #D93A48; color: #fff; }
.opt:disabled:not(.is-right):not(.is-wrong) { opacity: .55; }
.ex-choice-grid .opts { grid-template-columns: 1fr 1fr; }
.ex-choice-grid .opt { min-height: 56px; }
.ex-choice-grid .opt-key { display: none; }
.ex-choice-grid .opt-text { text-align: center; }

/* 听力 */
.ex-listen { min-height: 150px; }
.listen-voice { display: flex; align-items: center; gap: 16px; }
.listen-fallback { display: none; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.tag-novoice { padding: 3px 12px; border-radius: 999px; background: var(--sun-soft); color: var(--sun-deep); font-size: 13px; font-weight: 800; }
.listen-fallback-note { font-size: 13px; color: var(--muted); }
:root[data-voice="no"] .listen-voice { display: none; }
:root[data-voice="no"] .listen-fallback { display: flex; }

.ex-scene { padding: 0; border: 0; background: none; min-height: 0; display: block; }

/* 输入 */
.ex-input {
  width: 100%; min-height: 58px; padding: 12px 16px; border-radius: var(--r-md);
  border: 2px solid var(--line); background: var(--surface); font-size: 22px; font-weight: 700;
  font-family: var(--font-round); resize: none; outline-offset: 0;
}
textarea.ex-input { font-size: 19px; line-height: 1.4; }
.ex-input::placeholder { color: var(--muted); opacity: .7; font-weight: 500; font-size: 16px; }
.ex-input:focus { border-color: var(--btn); outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.ex-input.is-right { border-color: #0E9C8B; background: var(--ok-soft); opacity: 1; -webkit-text-fill-color: var(--ink); }
.ex-input.is-wrong { border-color: #D93A48; background: var(--lingon-soft); opacity: 1; -webkit-text-fill-color: var(--ink); text-decoration: line-through; text-decoration-color: #D93A48; }
.sv-keys { display: flex; gap: 10px; }
.sv-key {
  width: 52px; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 3px 0 var(--line); font-size: 20px; font-weight: 700;
}
.sv-key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

/* 问答 */
.qa-q { display: flex; align-items: flex-start; gap: 10px; }
.qa-avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--sun-soft); font-size: 26px; }
.qa-bubble {
  position: relative; flex: 1; min-width: 0; padding: 12px 14px; border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg);
  background: var(--surface); border: 2px solid var(--line);
}
.qa-q-sv { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 22px; font-weight: 800; line-height: 1.3; }
.qa-q-sv > span { min-width: 0; overflow-wrap: anywhere; }
.qa-q-zh { color: var(--muted); font-size: 14px; }
.qa-goal b { color: var(--ink); }

.order-line {
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; min-height: 76px; padding: 12px;
  border-radius: var(--r-md); border: 2px dashed var(--line); background: var(--surface);
}
.order-line.is-right { border-style: solid; border-color: #0E9C8B; background: var(--ok-soft); }
.order-line.is-wrong { border-style: solid; border-color: #D93A48; background: var(--lingon-soft); }
.order-placeholder { align-self: center; color: var(--muted); font-size: 14px; }
.order-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding-top: 4px; }
.chunk {
  min-height: 48px; padding: 8px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 4px 0 var(--line); font-size: 19px; font-weight: 700; font-family: var(--font-round); color: var(--ink);
  display: inline-flex; align-items: center;
}
.chunk:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.chunk-picked { border-color: var(--btn); background: var(--brand-soft); box-shadow: 0 4px 0 var(--btn); animation: pop .22s; }
.chunk-ghost { color: transparent; background: var(--soft); box-shadow: none; border-style: dashed; user-select: none; }

/* combo：新组合题的中文设定框 */
.combo-setup { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--brand-soft); border: 2px dashed var(--brand); }
.combo-setup-tag { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; }
.combo-setup-text { font-size: 17px; font-weight: 700; line-height: 1.45; }
