/* 京剧泡泡问答 — 样式 */

:root {
  --gold: #e8c07a;
  --gold-dim: rgba(232, 192, 122, .55);
  --cream: #fff3dc;
  --font-ui: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --font-zh: "KaiTi", "STKaiti", "Kaiti SC", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  background: radial-gradient(120% 90% at 50% 0%, #5a1420 0%, #330a14 46%, #170409 100%);
  color: var(--cream);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* 背景金线纹样 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(232, 192, 122, .045) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(-45deg, rgba(232, 192, 122, .03) 0 1px, transparent 1px 22px);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------------- 顶部 HUD ---------------- */
#hud {
  flex: none;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(232, 192, 122, .16);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(232, 192, 122, .4);
  background: rgba(255, 235, 200, .06);
  color: var(--gold);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .2s;
}

.icon-btn:hover { background: rgba(255, 235, 200, .14); }

#levelName {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hearts { display: flex; gap: 3px; }

.heart {
  color: #ff5b6e;
  font-size: 17px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 80, 100, .55);
  transition: opacity .25s, filter .25s;
}

.heart.lost { opacity: .2; filter: grayscale(1); }

/* ---------------- 题目卡片 ---------------- */
#questionBar {
  position: relative;
  flex: none;
  margin: 10px 14px 6px;
  padding: 12px 18px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 238, 214, .10), rgba(255, 238, 214, .035));
  border: 1px solid rgba(232, 192, 122, .32);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

#qTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  padding-right: 100px;
}

#qMeta {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold-dim);
}

.dots { display: flex; gap: 6px; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 192, 122, .55);
  transition: background .2s, box-shadow .2s;
}

.dot.done {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(232, 192, 122, .85);
}

#qText {
  font-family: var(--font-zh);
  font-size: clamp(19px, 2.5vw, 27px);
  line-height: 1.45;
  color: #fff6e4;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
  min-height: 1.45em;
  padding-right: 96px;
}

#qText.q-in { animation: qIn .4s ease-out; }

@keyframes qIn {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 游戏区 ---------------- */
#field {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  min-height: 0;
  margin: 0 10px 10px;
}

#bubbleLayer, #fxLayer {
  position: absolute;
  inset: 0;
}

#bubbleLayer { z-index: 2; }

#fxLayer {
  z-index: 5;
  pointer-events: none;
}

/* ---------------- 两侧京剧小人 ---------------- */
#mascotLayer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.mascot {
  position: absolute;
  top: 53%;
  transform: translateY(-50%);
  width: 104px;
  display: flex;
  justify-content: center;
  opacity: .97;
}

.mascot-left { left: 8px; }
.mascot-right { right: 8px; }

.mascot-float {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: mascotFloat 4.6s ease-in-out infinite;
}

.mascot-right .mascot-float { animation-delay: -2.1s; }

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.mascot-head {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  z-index: 2;
}

.mascot-head.red {
  background: radial-gradient(circle at 36% 28%, #ef6a58, #c33a34 52%, #8f1d1f 100%);
  box-shadow: inset 0 -10px 18px rgba(80, 10, 10, .45),
    inset 0 8px 14px rgba(255, 200, 180, .35),
    0 8px 18px rgba(0, 0, 0, .45);
}

.mascot-head.white {
  background: radial-gradient(circle at 36% 28%, #fffdf7, #f3e8d4 58%, #d9c4a6 100%);
  box-shadow: inset 0 -10px 18px rgba(120, 90, 60, .35),
    inset 0 8px 14px rgba(255, 255, 255, .8),
    0 8px 18px rgba(0, 0, 0, .45);
}

.mascot-eye {
  position: absolute;
  top: 41%;
  width: 20%;
  height: 13%;
  background: #17100d;
  border-radius: 50%;
}

.mascot-eye.left { left: 13%; transform: rotate(-12deg); }
.mascot-eye.right { right: 13%; transform: rotate(12deg); }

.mascot-head.white .mascot-eye {
  height: 9%;
  top: 43%;
  border-radius: 48% 48% 44% 44%;
}

.mascot-eye::after {
  content: "";
  position: absolute;
  left: 20%;
  top: 16%;
  width: 32%;
  height: 26%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
}

/* 眉毛：红脸上扬显英气，白脸下压显奸诈 */
.mascot-brow {
  position: absolute;
  top: 27%;
  width: 31%;
  height: 8%;
  background: #17100d;
  border-radius: 6px;
}

.mascot-brow.left { left: 8%; transform: rotate(-15deg); }
.mascot-brow.right { right: 8%; transform: rotate(15deg); }

.mascot-head.white .mascot-brow.left { transform: rotate(15deg); }
.mascot-head.white .mascot-brow.right { transform: rotate(-15deg); }

/* 髯口（假胡须） */
.mascot-beard {
  position: absolute;
  left: 50%;
  top: 73%;
  transform: translateX(-50%);
  width: 54%;
  height: 54%;
  background: linear-gradient(180deg, #211a17, #0a0807 72%);
  border-radius: 46% 46% 52% 52% / 26% 26% 74% 74%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
}

/* 关羽的三绺长髯 */
.mascot-head.red .mascot-beard { width: 46%; height: 62%; }

.mascot-head.red .mascot-beard::before,
.mascot-head.red .mascot-beard::after {
  content: "";
  position: absolute;
  top: 8%;
  width: 38%;
  height: 48%;
  background: #120d0b;
  border-radius: 50%;
}

.mascot-head.red .mascot-beard::before { left: -34%; transform: rotate(7deg); }
.mascot-head.red .mascot-beard::after { right: -34%; transform: rotate(-7deg); }

/* 曹操的黑色满髯 */
.mascot-head.white .mascot-beard {
  width: 60%;
  height: 50%;
  background: linear-gradient(180deg, #2b2523, #0d0a09 78%);
}

.mascot-hat {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 94%;
  height: 32px;
  background: linear-gradient(180deg, #f8e3ae, #d6a95c 62%, #a97a33);
  border-radius: 50% 50% 16% 16% / 86% 86% 14% 14%;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2);
  z-index: 3;
}

.mascot-pom {
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c8392f;
  box-shadow: 0 0 10px rgba(255, 90, 70, .75);
}

/* 曹操的帽翅 */
.mascot-wing {
  position: absolute;
  top: 15px;
  width: 38px;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, #1a1310, #0b0807);
}

.mascot-wing.left { left: -34px; transform: rotate(-8deg); }
.mascot-wing.right { right: -34px; transform: rotate(8deg); }

.mascot-body {
  position: relative;
  width: 82px;
  height: 72px;
  margin-top: -10px;
  border-radius: 46% 46% 26% 26% / 32% 32% 22% 22%;
  border: 2px solid rgba(232, 192, 122, .6);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .4);
}

.mascot-body.red { background: linear-gradient(180deg, #b3282f, #74121a 70%, #4d0a0f); }
.mascot-body.white { background: linear-gradient(180deg, #33405a, #1b2436 70%, #10151f); }

.mascot-body::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  width: 70%;
  height: 42%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 20%, rgba(232, 192, 122, .55), rgba(232, 192, 122, 0) 70%);
}

/* 领口云肩 */
.mascot-body::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6%;
  transform: translateX(-50%);
  width: 58%;
  height: 46%;
  border: 2px solid rgba(232, 192, 122, .5);
  border-top: none;
  border-radius: 0 0 50% 50%;
}

.mascot.talk .mascot-head { animation: mascotPop .5s ease; }

@keyframes mascotPop {
  0%, 100% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.09) rotate(-4deg); }
  70% { transform: scale(1.04) rotate(3deg); }
}

/* 小人的对白气泡 */
#sayLayer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.say {
  position: absolute;
  max-width: 200px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff8ec;
  border: 2px solid #e8c07a;
  color: #4a1018;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(8px) scale(.92);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.say::after {
  content: "";
  position: absolute;
  top: 100%;
  border: 8px solid transparent;
  border-top-color: #e8c07a;
}

.say-left { left: 6px; bottom: calc(47% + 86px); }
.say-left::after { left: 34px; }
.say-right { right: 6px; bottom: calc(47% + 86px); }
.say-right::after { right: 34px; }

.say.show { opacity: 1; transform: translateY(0) scale(1); }

/* ---------------- 答错时整屏震动 ---------------- */
#app.shake { animation: screenShake .42s cubic-bezier(.36, .07, .19, .97); }

@keyframes screenShake {
  10%, 90% { transform: translate3d(-2px, 1px, 0); }
  20%, 80% { transform: translate3d(4px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 2px, 0); }
  40%, 60% { transform: translate3d(6px, -1px, 0); }
}

/* ---------------- 泡泡 ---------------- */
.bubble {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  touch-action: none;
  cursor: pointer;
  animation: bubbleIn .3s ease-out;
}

@keyframes bubbleIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bubble-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #ffffff 0%, #fff6ec 16%, #ffddc9 42%, #f3ab93 68%, #d1806d 88%, #b7655a 100%);
  border: 2px solid rgba(255, 240, 220, .85);
  box-shadow:
    inset 0 -12px 26px rgba(150, 50, 50, .3),
    inset 0 12px 20px rgba(255, 255, 255, .7),
    0 12px 26px rgba(0, 0, 0, .42),
    0 0 26px rgba(232, 192, 122, .22);
  color: #5e0f1c;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .5px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .12s ease;
  overflow: hidden;
}

/* 泡泡左上角的高光 */
.bubble-inner::after {
  content: "";
  position: absolute;
  left: 19%;
  top: 13%;
  width: 27%;
  height: 17%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  filter: blur(3px);
  transform: rotate(-28deg);
  pointer-events: none;
}

.bubble:hover .bubble-inner { transform: scale(1.04); }
.bubble:active .bubble-inner { transform: scale(.96); }

.bubble.popped .bubble-inner { animation: bubblePop .38s ease-out forwards; }

.bubble.wrong .bubble-inner {
  color: #fff;
  background: radial-gradient(circle at 34% 24%, #ffe8e8, #ffb3b3 35%, #e85050 70%, #b82222 100%);
  border-color: rgba(255, 210, 210, .9);
  box-shadow: 0 0 26px rgba(255, 60, 60, .65);
  animation: shake .45s ease;
}

.bubble.gone .bubble-inner { animation: vanish .4s ease-in forwards; }

@keyframes bubblePop {
  0% { transform: scale(1); opacity: 1; }
  45% { transform: scale(1.16); opacity: .92; }
  100% { transform: scale(.25); opacity: 0; }
}

@keyframes vanish {
  to { transform: scale(.4) translateY(-14px); opacity: 0; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

/* ---------------- 提示条 ---------------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 12px);
  padding: 10px 20px;
  border-radius: 18px;
  background: rgba(24, 5, 10, .9);
  border: 1px solid rgba(232, 192, 122, .45);
  color: var(--cream);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  max-width: 92%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 20;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255, 110, 120, .6); }

/* ---------------- 粒子 ---------------- */
.particle {
  position: absolute;
  border-radius: 50%;
  background: #ffd98a;
  box-shadow: 0 0 8px rgba(255, 200, 140, .8);
  animation: burst .7s ease-out forwards;
  pointer-events: none;
}

@keyframes burst {
  to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}

/* ---------------- 弹层 ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 2, 4, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.overlay.show { opacity: 1; pointer-events: auto; }

.panel {
  width: min(92vw, 540px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 28px 26px;
  border-radius: 22px;
  background: linear-gradient(165deg, #43101c 0%, #2a0812 55%, #1c050b 100%);
  border: 1px solid rgba(232, 192, 122, .5);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: center;
  animation: panelIn .3s ease-out;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.panel-kicker {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gold-dim);
  margin-bottom: 8px;
}

.panel-title {
  font-family: var(--font-zh);
  font-size: clamp(26px, 5vw, 34px);
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 2px;
}

.panel-lead {
  margin: 0 0 18px;
  font-size: 15px;
  color: rgba(255, 243, 220, .85);
  line-height: 1.6;
}

.rules {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 12px;
}

.rules li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 235, 200, .055);
  border: 1px solid rgba(232, 192, 122, .16);
}

.rules b { flex: none; color: var(--gold); font-weight: 700; }

.panel-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  padding: 13px 30px;
  border-radius: 999px;
  letter-spacing: 1px;
  transition: transform .12s, filter .2s, background .2s;
}

.btn:active { transform: scale(.97); }

.btn.primary {
  background: linear-gradient(180deg, #f0cf8f, #d9a955);
  color: #4a1018;
  box-shadow: 0 8px 22px rgba(217, 169, 85, .3);
}

.btn.primary:hover { filter: brightness(1.05); }

.btn.ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(232, 192, 122, .5);
}

.btn.ghost:hover { background: rgba(232, 192, 122, .1); }

.fact {
  text-align: left;
  font-size: 14px;
  line-height: 1.7;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(232, 192, 122, .07);
  border-left: 3px solid var(--gold);
  color: rgba(255, 243, 220, .9);
  margin-bottom: 20px;
}

.fact b {
  display: block;
  color: var(--gold);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 6px 0 22px;
}

.stats div {
  flex: 1;
  max-width: 140px;
  padding: 14px 8px;
  border-radius: 14px;
  background: rgba(255, 235, 200, .06);
  border: 1px solid rgba(232, 192, 122, .2);
}

.stats b {
  display: block;
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 4px;
  white-space: nowrap;
}

.stats span {
  font-size: 12px;
  color: rgba(255, 243, 220, .65);
  letter-spacing: 1px;
}

.panel-foot {
  margin: 18px 0 0;
  font-size: 12px;
  color: rgba(255, 243, 220, .5);
  letter-spacing: 1px;
}

.level-pick {
  margin-top: 18px;
  font-size: 13px;
  color: rgba(255, 243, 220, .6);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.chip {
  border: 1px solid rgba(232, 192, 122, .4);
  background: transparent;
  color: var(--gold);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s;
}

.chip:hover { background: rgba(232, 192, 122, .12); }

/* ---------------- 小屏适配 ---------------- */
@media (max-width: 520px) {
  #hud { height: 50px; padding: 6px 10px; gap: 8px; }
  #questionBar { margin: 8px 10px 4px; padding: 10px 14px 12px; }
  #qText { font-size: 19px; }
  #field { margin: 0 6px 6px; }
  .panel { padding: 24px 18px 20px; }
  .rules li { font-size: 14px; padding: 9px 12px; }
  .btn { padding: 12px 24px; font-size: 15px; }
  .stats { gap: 8px; }
  .stats b { font-size: 16px; }

  .mascot { width: 64px; top: 47%; }
  .mascot-left { left: 2px; }
  .mascot-right { right: 2px; }
  .mascot-head { width: 56px; height: 56px; }
  .mascot-hat { top: -10px; height: 20px; }
  .mascot-pom { width: 9px; height: 9px; top: -8px; }
  .mascot-wing { width: 22px; height: 6px; top: 9px; }
  .mascot-wing.left { left: -20px; }
  .mascot-wing.right { right: -20px; }
  .mascot-body { width: 52px; height: 46px; margin-top: -6px; }
  .mascot-eye { width: 21%; height: 12%; }
  .mascot-brow { height: 7%; }

  .say {
    max-width: 148px;
    font-size: 12px;
    padding: 8px 11px;
    border-radius: 13px;
  }
  .say-left { left: 4px; bottom: calc(53% + 54px); }
  .say-left::after { left: 26px; }
  .say-right { right: 4px; bottom: calc(53% + 54px); }
  .say-right::after { right: 26px; }
}

/* ================= v1.3：倒计时 / 计分 / 技能 ================= */

/* 得分 */
.score-tag {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .5px;
  white-space: nowrap;
  transition: transform .15s;
}

.score-tag.pop { transform: scale(1.18); }

/* 倒计时炸弹（绝对定位在题目栏右上角，不撑高题目栏） */
.bomb {
  --fuse: 1;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 96px;
  height: 110px;
  margin: 0;
  z-index: 4;
}

.bomb-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.bomb-fuse-burnt {
  fill: none;
  stroke: #2a241e;
  stroke-width: 8;
  stroke-linecap: round;
}

.bomb-fuse-unburnt {
  fill: none;
  stroke: #f0dcb0;
  stroke-width: 8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px rgba(255, 210, 140, .55));
}

#bombFlame circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: flamePulse .18s ease-in-out infinite alternate;
}

#bombFlame circle:last-child {
  animation-duration: .12s;
}

@keyframes flamePulse {
  from { transform: scale(.82); opacity: .8; }
  to { transform: scale(1.18); opacity: 1; }
}

.bomb-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #5d5d6a 0%, #2b2b35 44%, #111117 78%, #050508 100%);
  box-shadow:
    inset -9px -11px 20px rgba(0, 0, 0, .82),
    inset 7px 9px 16px rgba(255, 255, 255, .17),
    0 10px 22px rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.bomb-cap {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 14px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #d3d3dd, #5d5d68 58%, #33333b);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  z-index: 3;
}

#timerNum {
  position: relative;
  font-size: 26px;
  font-weight: 800;
  color: #ffe9a8;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 180, 80, .5);
  z-index: 3;
}

.bomb.warn #timerNum { color: #ffd27a; }

.bomb.warn .bomb-fuse-unburnt { stroke: #ffe2a4; }

.bomb.danger .bomb-body {
  animation: bombPulse .7s ease-in-out infinite;
}

.bomb.danger #timerNum { color: #ff6b6b; }

.bomb.danger .bomb-fuse-unburnt {
  stroke: #ffcc8a;
  filter: drop-shadow(0 0 3px rgba(255, 120, 40, .8));
}

@keyframes bombPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.07); }
}

.bomb.boom .bomb-svg { opacity: 0; transition: opacity .15s; }

.bomb.boom .bomb-body {
  animation: bombBlast .6s ease-out forwards;
}

@keyframes bombBlast {
  0% { transform: translateX(-50%) scale(1); filter: brightness(1); }
  25% { transform: translateX(-50%) scale(1.5); filter: brightness(2.6); }
  60% { transform: translateX(-50%) scale(.9); opacity: .85; filter: brightness(1.6); }
  100% { transform: translateX(-50%) scale(.15); opacity: 0; filter: brightness(1); }
}

/* 技能按钮 */
.tool-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.skill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(232, 192, 122, .4);
  background: rgba(255, 235, 200, .06);
  color: var(--cream);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background .2s, opacity .2s;
}

.skill-btn b {
  font-size: 11px;
  background: var(--gold);
  color: #4a1018;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.skill-btn:hover { background: rgba(255, 235, 200, .14); }

.skill-btn:disabled {
  opacity: .32;
  cursor: default;
}

.tool-row.hidden { display: none; }

/* 最后 20 秒：屏幕四角红色暗角 */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s;
  box-shadow: inset 0 0 150px 44px rgba(255, 40, 40, .62);
}

#app.hurry #vignette {
  opacity: 1;
  animation: vignettePulse 1s ease-in-out infinite;
}

@keyframes vignettePulse {
  0%, 100% { opacity: .4; }
  50% { opacity: .95; }
}

/* 紧迫时每秒一下的小震动 */
#app.shake-small { animation: screenShakeSmall .16s linear; }

@keyframes screenShakeSmall {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-3px, 1px, 0); }
  50% { transform: translate3d(3px, -1px, 0); }
  75% { transform: translate3d(-2px, -1px, 0); }
}

/* 长选项：允许两行 */
.bubble-inner--wrap {
  padding: 7%;
  line-height: 1.08;
}

/* 超时/复习时亮出正确答案 */
.bubble.reveal .bubble-inner {
  animation: revealGlow .9s ease-in-out infinite alternate;
}

@keyframes revealGlow {
  from { box-shadow: 0 0 0 rgba(255, 220, 140, 0); }
  to { box-shadow: 0 0 36px rgba(255, 220, 140, .95), inset 0 0 20px rgba(255, 230, 180, .6); }
}

/* 飘分 */
.score-float {
  position: absolute;
  left: 0;
  top: 0;
  color: #ffe9a8;
  font-weight: 800;
  font-size: 20px;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); }
  20% { opacity: 1; transform: translate(-50%, -60%) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}

/* 连对提示 */
.combo-pop {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  font-size: 34px;
  font-weight: 900;
  color: #ffe9a8;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(255, 180, 80, .85), 0 3px 10px rgba(0, 0, 0, .6);
  pointer-events: none;
  animation: comboPop 1s ease-out forwards;
}

@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(.95); }
}

/* 星级 */
.stars {
  font-size: 32px;
  letter-spacing: 8px;
  margin: 2px 0 18px;
}

.stars .star { color: rgba(255, 235, 200, .18); }
.stars .star.on { color: #ffd76a; text-shadow: 0 0 16px rgba(255, 200, 80, .8); }

/* 复习模式标记 */
.review-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(232, 192, 122, .18);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 1px;
}

/* 小屏 */
@media (max-width: 520px) {
  .bomb { width: 78px; height: 92px; right: 8px; }
  .bomb-body { width: 58px; height: 58px; }
  #timerNum { font-size: 20px; }
  #qTop { padding-right: 78px; }
  #qText { padding-right: 76px; }
  .tool-row { gap: 6px; margin-top: 6px; }
  .skill-btn { font-size: 12px; padding: 4px 10px; }
  .score-tag { font-size: 12px; }
  .combo-pop { font-size: 26px; }
  .stars { font-size: 26px; }
}
