/* ============================================================
   你划我猜 · 航空版 —— 样式表
   设计基调：暗色航电（avionics）/ HUD 仪表风，蓝白主色呼应 C919
   无任何外部字体 / 图片依赖，仅使用系统字体栈
   ============================================================ */

:root {
  /* 主色 */
  --c-ink:        #04080f;
  --c-ink-2:      #071322;
  --c-panel:      rgba(10, 24, 40, 0.72);
  --c-panel-2:    rgba(12, 30, 50, 0.85);
  --c-line:       rgba(96, 174, 232, 0.28);
  --c-line-soft:  rgba(96, 174, 232, 0.14);

  --c-blue:       #1f6fd0;
  --c-blue-deep:  #14508f;
  --c-cyan:       #3fd0f5;
  --c-cyan-dim:   #1d90b4;
  --c-white:      #f2f8ff;
  --c-text:       #dbe9f7;
  --c-text-dim:   #8fabc4;

  --c-good:       #2ee08a;
  --c-good-deep:  #10824e;
  --c-warn:       #ffbe3d;
  --c-bad:        #ff5d5d;

  --radius:       16px;
  --radius-sm:    10px;

  /* 词条 scrim 的不透明度 —— 这是「词条清晰度 ↔ 全屏平均亮度」的唯一旋钮。
     调高：词压白云更好认，但整屏会略暗；调低反之。
     0.36 是「词框两端压最亮云时对比 ≥1.8」所需的下限再留 3% 余量。 */
  --word-scrim:   0.36;

  --font-sys: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
              "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei",
              system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "DIN Alternate", "Bahnschrift", "Segoe UI", Impact,
              "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--c-ink);
  color: var(--c-text);
  font-family: var(--font-sys);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

body { overflow: hidden; }

kbd {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 2px;
  border: 1px solid var(--c-line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(63, 208, 245, 0.10);
  color: var(--c-cyan);
  font-family: var(--font-sys);
  font-size: 0.85em;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ============================================================
   背景层
   ============================================================ */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  background: linear-gradient(180deg, #071a2e 0%, #0d2b46 45%, #14395c 100%);
}

#scene.is-off { display: none; }

/* 顶部/底部压暗，保证文字可读。
   答题态下飞机被安排在画面下部，所以这里把中下段的压暗几乎去掉，
   只在最顶部（HUD 那一条）留压暗，最底部只留一层很薄的收边。
   最底部从 0.42 收到 0.12 还有一个作用：词条 scrim 会吃掉一点整屏亮度，
   这里把下半屏（飞机所在区域）提亮回来，两边的账正好相抵 —— 而且方向是
   「飞机更亮」，不会违背「不许压暗飞机」。 */
#scene-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 68% at 50% 0%, rgba(3, 8, 16, 0.62) 0%, rgba(3, 8, 16, 0.06) 44%, rgba(3, 8, 16, 0) 72%),
    linear-gradient(180deg,
      rgba(3, 8, 16, 0.70) 0%,
      rgba(3, 8, 16, 0.04) 16%,
      rgba(3, 8, 16, 0) 58%,
      rgba(3, 8, 16, 0) 80%,
      rgba(3, 8, 16, 0.08) 100%);
}

/* ---- WebGL 不可用时的退化场景 ---- */
.scene-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  overflow: hidden;
  background: linear-gradient(180deg, #04101f 0%, #0a2b4a 40%, #17618f 74%, #4aa8c9 100%);
}

.scene-fallback.is-on { display: block; }

.fb-sun {
  position: absolute;
  top: 16%;
  right: 20%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 214, 0.95) 0%, rgba(255, 214, 130, 0.45) 38%, rgba(255, 214, 130, 0) 72%);
  filter: blur(2px);
}

.fb-cloud {
  position: absolute;
  height: 70px;
  border-radius: 100px;
  background: rgba(226, 244, 255, 0.30);
  filter: blur(14px);
}
.fb-c1 { width: 420px; top: 30%; left: -8%; }
.fb-c2 { width: 300px; top: 62%; left: 55%; height: 54px; }
.fb-c3 { width: 520px; top: 78%; left: 22%; height: 88px; }

.fb-plane {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 320px;
  transform: translate(-50%, -50%) rotate(-4deg);
  color: rgba(226, 244, 255, 0.85);
  filter: drop-shadow(0 18px 30px rgba(0, 20, 40, 0.55));
}
.fb-plane svg { width: 100%; height: auto; display: block; }

/* ============================================================
   布局骨架
   ============================================================ */
/* #app 必须给自己一个确定高度，否则下面 .app-layer 的 height:100%
   会退化成 auto（内容撑高）—— 表现就是「大屏上内容只占 800px、
   底部按钮行悬在屏幕中间、飞机下半部正好被它压住」。
   html/body 已经是 height:100%，这里接上就能把高度链打通。 */
#app {
  position: relative;
  height: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-layer {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.app-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 18px;
  padding: 0 22px 14px;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  display: flex;
}

/* ============================================================
   HUD 顶栏
   ============================================================ */
#hud {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 22px 12px;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

/* 左上角标识：填培训活动名称（14 个汉字），右侧 .hud-title 仍是游戏名。
   ★ 行高必须钉死 24 px：汉字字体度量比西文高 3 px，不钉死盒高会从 32 → 35 px，
     连带 #hud 高度变化、遮挡断言口径全变。24 + 4×2 = 32 px。
   ★ 14 字若沿用 20 px 会长到约 300 px，把 .hud-title 挤出可视区，
     所以字号改成随视口自适应：1280 → 13 px、1600 → 14 px、1024 → 11 px。
     上下 padding 保持 4 px 不动，盒高恒定 32 px。 */
.hud-logo {
  font-family: var(--font-num);
  font-size: clamp(11px, 1.02vw, 14px);
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--c-ink);
  background: linear-gradient(140deg, var(--c-cyan) 0%, #7fe3ff 60%, #ffffff 100%);
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(63, 208, 245, 0.45);
  white-space: nowrap;
}

.hud-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--c-white);
  white-space: nowrap;
}
.hud-title em {
  font-style: normal;
  color: var(--c-cyan);
  margin: 0 2px;
}

.hud-mission {
  flex: 1 1 auto;
  max-width: 460px;
  margin-left: auto;
}

.mission-label {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--c-text-dim);
  margin-bottom: 5px;
}
.mission-label b {
  font-family: var(--font-num);
  font-size: 14px;
  color: var(--c-cyan);
  letter-spacing: 1px;
}

.mission-bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(120, 180, 230, 0.16);
  overflow: hidden;
  border: 1px solid rgba(120, 180, 230, 0.18);
}

.mission-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--c-blue) 0%, var(--c-cyan) 100%);
  box-shadow: 0 0 12px rgba(63, 208, 245, 0.7);
  transition: width 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.hud-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-chip {
  font-size: 13px;
  color: var(--c-text-dim);
  padding: 6px 12px;
  border: 1px solid var(--c-line);
  border-radius: 99px;
  background: rgba(8, 22, 38, 0.6);
  white-space: nowrap;
}
.hud-chip b {
  font-family: var(--font-num);
  color: var(--c-white);
  font-size: 15px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--c-line);
  background: rgba(8, 22, 38, 0.6);
  color: var(--c-cyan);
  font-size: 17px;
  cursor: pointer;
  transition: background 160ms, border-color 160ms, transform 160ms;
}
.icon-btn:hover {
  background: rgba(63, 208, 245, 0.16);
  border-color: var(--c-cyan);
}
.icon-btn:active { transform: scale(0.94); }

/* ============================================================
   通用面板 / 按钮
   ============================================================ */
.panel {
  position: relative;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  background:
    linear-gradient(180deg, rgba(14, 34, 56, 0.86) 0%, rgba(6, 16, 28, 0.90) 100%);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow:
    0 24px 64px rgba(0, 6, 14, 0.6),
    inset 0 1px 0 rgba(120, 200, 255, 0.14);
  padding: 26px 30px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 208, 245, 0.35) transparent;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb {
  background: rgba(63, 208, 245, 0.32);
  border-radius: 99px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  background: rgba(14, 34, 56, 0.8);
  color: var(--c-text);
  font-family: var(--font-sys);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 11px 20px;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, background 160ms, border-color 160ms, box-shadow 160ms;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  border-color: transparent;
  color: #04121f;
  background: linear-gradient(135deg, #6fe4ff 0%, var(--c-cyan) 42%, var(--c-blue) 100%);
  box-shadow: 0 10px 28px rgba(45, 160, 220, 0.42);
}
.btn-primary:hover { box-shadow: 0 12px 34px rgba(63, 208, 245, 0.6); }

.btn-ghost { background: rgba(8, 22, 38, 0.55); }
.btn-ghost:hover { background: rgba(63, 208, 245, 0.12); border-color: var(--c-cyan); }

.btn-danger {
  border-color: rgba(255, 93, 93, 0.5);
  color: #ffd7d7;
  background: rgba(80, 16, 20, 0.5);
}
.btn-danger:hover { background: rgba(140, 26, 32, 0.6); border-color: var(--c-bad); }

.btn-lg { font-size: 17px; padding: 15px 34px; }

.btn-mini {
  font-size: 12.5px;
  padding: 8px 10px;
  letter-spacing: 0.5px;
  flex: 1 1 0;
  white-space: nowrap;
}

/* ============================================================
   屏幕切换
   ============================================================ */
.screen {
  display: none;
  width: 100%;
  min-height: 0;
}
.screen.is-active { display: flex; }

/* ============================================================
   屏幕 1：准备 / 设置
   ============================================================ */
#screen-setup.is-active { animation: fadeUp 320ms ease both; }

.panel-setup { max-width: 980px; margin: auto; }

.setup-title {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--c-white);
}
.setup-title span {
  background: linear-gradient(120deg, var(--c-cyan), #9be9ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.setup-sub {
  margin: 0 0 22px;
  font-size: 13.5px;
  letter-spacing: 2px;
  color: var(--c-text-dim);
}

.setup-block { margin-bottom: 20px; }

.block-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--c-cyan);
}
.block-title i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-style: normal;
  font-size: 12px;
  font-family: var(--font-num);
  color: #04121f;
  background: var(--c-cyan);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.team-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--c-line-soft);
  border-radius: var(--radius-sm);
  background: rgba(6, 18, 30, 0.55);
  transition: border-color 160ms, background 160ms;
}
.team-field:focus-within {
  border-color: var(--c-cyan);
  background: rgba(63, 208, 245, 0.08);
}

.team-field .tf-idx {
  flex: 0 0 auto;
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--c-cyan-dim);
  min-width: 14px;
  text-align: center;
}

.team-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--c-white);
  font-family: var(--font-sys);
  font-size: 14.5px;
  letter-spacing: 1px;
  padding: 2px 0;
}
.team-field input::placeholder { color: rgba(143, 171, 196, 0.55); }

.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--c-line-soft);
  border-radius: 12px;
  background: rgba(6, 18, 30, 0.6);
}

.seg-btn {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--c-text-dim);
  font-family: var(--font-sys);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 9px 22px;
  cursor: pointer;
  transition: background 160ms, color 160ms;
}
.seg-btn:hover { color: var(--c-white); }
.seg-btn.is-on {
  color: #04121f;
  background: linear-gradient(135deg, #7ee8ff, var(--c-cyan));
  box-shadow: 0 4px 16px rgba(63, 208, 245, 0.4);
}

.module-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border: 1px solid var(--c-line-soft);
  border-radius: var(--radius-sm);
  background: rgba(6, 18, 30, 0.5);
  cursor: pointer;
  user-select: none;
  transition: border-color 160ms, background 160ms;
}
.module-item:hover { border-color: var(--c-line); }
.module-item.is-on {
  border-color: rgba(63, 208, 245, 0.5);
  background: rgba(63, 208, 245, 0.07);
}

.mi-box {
  position: relative;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(120, 180, 230, 0.45);
  background: rgba(0, 0, 0, 0.25);
  transition: background 160ms, border-color 160ms;
}
.mi-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #04121f;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(42deg) scale(0);
  transition: transform 140ms ease;
}
.module-item.is-on .mi-box {
  background: var(--c-cyan);
  border-color: var(--c-cyan);
}
.module-item.is-on .mi-box::after { transform: rotate(42deg) scale(1); }

.mi-text { flex: 1 1 auto; min-width: 0; }
.mi-name {
  display: block;
  font-size: 14.5px;
  color: var(--c-white);
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mi-count {
  display: block;
  font-size: 11.5px;
  color: var(--c-text-dim);
  letter-spacing: 1px;
  margin-top: 2px;
}

.hint {
  margin: 11px 0 0;
  font-size: 12.5px;
  letter-spacing: 1px;
  color: var(--c-text-dim);
}
.hint b {
  font-family: var(--font-num);
  color: var(--c-cyan);
  font-size: 14px;
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--c-line-soft);
}

.setup-tip {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--c-text-dim);
  letter-spacing: 1px;
}

/* ============================================================
   屏幕 2：准备倒计时
   ============================================================ */
.panel-center {
  max-width: 760px;
  margin: auto;
  text-align: center;
  padding: 40px 30px 36px;
}

#screen-ready.is-active { animation: fadeUp 300ms ease both; }

.ready-round {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 5px;
  color: var(--c-text-dim);
  font-family: var(--font-num);
}

.ready-team {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--c-white);
  text-shadow: 0 0 40px rgba(63, 208, 245, 0.5);
}

.countdown {
  font-family: var(--font-num);
  font-size: clamp(90px, 16vw, 190px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #ffffff 0%, var(--c-cyan) 55%, var(--c-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(63, 208, 245, 0.5));
}
.countdown.tick { animation: popTick 720ms cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.countdown.go {
  font-size: clamp(70px, 12vw, 140px);
  letter-spacing: 8px;
  animation: popTick 520ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.ready-hint {
  margin: 18px 0 26px;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--c-text-dim);
}

/* ============================================================
   屏幕 3：答题
   ============================================================ */
#screen-play.is-active { animation: fadeUp 220ms ease both; }

.play-wrap {
  width: 100%;
  max-width: 1120px;
  /* 只做水平居中：写成 margin:auto 的话上下 auto 会吃掉剩余空间，
     这个 flex 子项就不再被拉伸到满高，底部按钮行又会浮到中间。 */
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 0 0;
}

.play-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: clamp(8px, 2vh, 22px);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 14px;
  letter-spacing: 1.5px;
  border: 1px solid var(--c-line);
  background: rgba(8, 22, 38, 0.7);
  color: var(--c-text);
  white-space: nowrap;
}
.tag-team {
  color: #04121f;
  border-color: transparent;
  background: linear-gradient(135deg, #7ee8ff, var(--c-cyan));
  font-weight: 700;
}
.tag-module { color: var(--c-cyan); }
.tag-count { color: var(--c-text-dim); }
.tag-count b {
  font-family: var(--font-num);
  color: var(--c-white);
  font-size: 16px;
  margin: 0 2px;
}

.word-stage {
  flex: 1 1 auto;
  display: flex;
  /* 词条靠版心顶部排，把画面中下部整块让给飞机。
     居中排的话「抬高飞机就会撞到字、压低飞机就被按钮压住」，两头不讨好。 */
  align-items: flex-start;
  justify-content: center;
  min-height: clamp(150px, 26vh, 320px);
  padding: clamp(6px, 2.4vh, 28px) 20px 10px;
}

.word {
  /* 基准档：≤4 字。更长的词由下方 [data-len] 档位覆盖；
     JS 渲染后还会按实测文本宽度再收缩一次兜底（见 ui.js fitWordToStage）。 */
  font-size: clamp(52px, 12.5vw, 168px);
  font-weight: 800;
  line-height: 1.06;
  /* 字距用 em 而不是 px/clamp：字号一缩，字距同比缩，
     收缩算法的「宽度 ∝ 字号」假设才成立，不会越缩越挤。 */
  letter-spacing: 0.07em;
  text-align: center;
  color: #ffffff;
  word-break: keep-all;
  /* 最后一道保险：万一用户往题库里塞了超长词，宁可折行也不横向裁切 */
  overflow-wrap: anywhere;
  max-width: 100%;
  position: relative;
  /* 对比度靠「深色描边」而不是「青色辉光」：
     辉光会把字周围的背景提亮，压在白云上反而更难认。
     第一层是**零偏移**的紧阴影 —— 在字形四周均匀压出一圈暗边，
     面积只比字形大几像素，几乎不消耗整屏亮度，却能把「最差局部对比」拉起来
     （上一版只有向下偏移的阴影，字形正上方没有暗边，长词头尾压白云时最差只有 1.35）。 */
  text-shadow:
    0 0 3px rgba(1, 6, 14, 1),
    0 0 7px rgba(1, 6, 14, 0.92),
    0 3px 10px rgba(1, 6, 14, 0.95),
    0 10px 34px rgba(1, 6, 14, 0.72),
    0 0 80px rgba(6, 26, 48, 0.45);
}

/* 紧贴词框的中性 scrim：**模糊实心块**，α 从头到尾恒定。
   上一版用 radial-gradient(ellipse 50% 58%)，词框宽而扁，渐变到左右两端时
   α 只剩 0.07~0.14 —— 而「补充型号合格证」这种长词的头尾正好落在低 α 区，
   压在最亮的云上 worst 只有 1.35。实心块保证整条词从第一个字到最后一个字
   都是同一个 α，再用 blur 把边缘化开，不会出现硬边矩形。
   竖向只比词框高 8%（+ blur 尾巴），够不到下方的飞机。
   blur 从 14px 提到 26px：高斯模糊是「守恒」的 —— 总暗量不变、只是摊开，
   所以边缘更柔但整屏亮度不受影响；横向 inset 从 -2% 放到 -6%，
   保证 26px 的柔化不会把词首尾的 α 削掉。 */
.word::before {
  content: "";
  position: absolute;
  inset: -8% -6%;
  z-index: -1;
  pointer-events: none;
  background: rgba(2, 9, 18, var(--word-scrim));
  filter: blur(26px);
}

/* 按字数分级降字号：真实题库最长的是「补充型号合格证」（7 字），
   8 字档是给「用户自己往 words.js 里塞更长的词」留的余量，别删。
   短词（≤4 字）保持原来的大字号不变。 */
.word[data-len="5"] { font-size: clamp(48px, 10.2vw, 144px); }
.word[data-len="6"] { font-size: clamp(42px, 8.6vw, 122px); }
.word[data-len="7"] { font-size: clamp(37px, 7.4vw, 106px); }
.word[data-len="8"] { font-size: clamp(34px, 6.6vw, 94px); }

/* 离屏测量副本：保留真实字体度量，但不参与布局、不可见 */
.word-measure {
  position: absolute !important;
  left: -99999px !important;
  top: 0 !important;
  visibility: hidden !important;
  white-space: nowrap !important;
  max-width: none !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  pointer-events: none !important;
  text-shadow: none !important;
  animation: none !important;
}
.word-measure::before { display: none !important; }

/* 换词动画只挂在 .wordIn 上：JS 通过「移除 → 强制回流 → 加回」重播 */
.word.wordIn {
  animation: wordIn 260ms cubic-bezier(0.2, 1.2, 0.3, 1) both;
}

.word.flash-good { animation: flashGood 340ms ease both; }
.word.flash-skip { animation: flashSkip 300ms ease both; }

.timer-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 4px auto clamp(12px, 2vh, 26px);
  width: min(100%, 820px);
}

.timer {
  flex: 0 0 auto;
  min-width: 130px;
  text-align: center;
  font-family: var(--font-num);
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--c-white);
  transition: color 220ms;
}
.timer small {
  font-size: 0.36em;
  letter-spacing: 2px;
  color: var(--c-text-dim);
  margin-left: 4px;
}
.timer.is-low {
  color: var(--c-bad);
  animation: pulseRed 1s ease-in-out infinite;
}

.timer-bar {
  flex: 1 1 auto;
  height: 12px;
  border-radius: 99px;
  background: rgba(120, 180, 230, 0.14);
  border: 1px solid rgba(120, 180, 230, 0.16);
  overflow: hidden;
}
.timer-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--c-blue) 0%, var(--c-cyan) 60%, #a7f0ff 100%);
  box-shadow: 0 0 16px rgba(63, 208, 245, 0.6);
  transition: width 120ms linear, background 260ms;
}
.timer-bar i.is-low {
  background: linear-gradient(90deg, #a01d1d 0%, var(--c-bad) 70%, #ff9a9a 100%);
  box-shadow: 0 0 16px rgba(255, 93, 93, 0.7);
}

.play-actions {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1.5fr;
  gap: 10px;
  width: min(100%, 980px);
  /* 竖向 auto：把按钮行顶到答题屏最底部，中间整块留给飞机 */
  margin: auto auto 0;
  padding-bottom: 0;
}

/* 固定高度而不是靠内容撑开：按钮行的高度直接决定它会压住飞机多少，
   交给内容自动撑会出现「不同字体/不同 DPR 下高度不一样」的不可控。 */
.play-actions .btn {
  flex-direction: column;
  gap: 2px;
  height: clamp(54px, 7.4vh, 66px);
  padding: 0 10px;
  font-size: clamp(16px, 1.9vw, 22px);
  line-height: 1.12;
  letter-spacing: 3px;
  border-radius: 14px;
}

.play-actions .btn small {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 1px;
  opacity: 0.62;
}

.btn-skip {
  border-color: rgba(255, 190, 61, 0.42);
  color: #ffe0a6;
  background: rgba(64, 44, 6, 0.45);
}
.btn-skip:hover { background: rgba(110, 76, 8, 0.55); border-color: var(--c-warn); }

.btn-pause {
  border-color: var(--c-line);
  color: var(--c-text-dim);
  background: rgba(8, 22, 38, 0.6);
}
.btn-pause:hover { color: var(--c-white); border-color: var(--c-cyan); }

.btn-correct {
  border-color: transparent;
  color: #03210f;
  background: linear-gradient(135deg, #9dffcd 0%, var(--c-good) 45%, #12a862 100%);
  box-shadow: 0 10px 32px rgba(46, 224, 138, 0.42);
}
.btn-correct:hover { box-shadow: 0 14px 40px rgba(46, 224, 138, 0.62); }

/* ============================================================
   屏幕 4：结算
   ============================================================ */
#screen-result.is-active { animation: fadeUp 320ms ease both; }

.panel-result {
  max-width: 800px;
  margin: auto;
  text-align: center;
  padding: 30px 34px 30px;
}

.result-title {
  margin: 0 0 22px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--c-white);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px 13px;
  border-radius: 12px;
  border: 1px solid var(--c-line-soft);
  background: rgba(6, 18, 30, 0.55);
}
.stat-hi {
  border-color: rgba(63, 208, 245, 0.45);
  background: rgba(63, 208, 245, 0.10);
  box-shadow: inset 0 0 24px rgba(63, 208, 245, 0.12);
}

.stat-num {
  font-family: var(--font-num);
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700;
  line-height: 1;
  color: var(--c-white);
}
.stat-hi .stat-num { color: var(--c-cyan); }

.stat-label {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--c-text-dim);
}

.result-rank {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed var(--c-line);
  background: rgba(6, 18, 30, 0.4);
  margin-bottom: 22px;
}

.rank-big {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--c-white);
}
.rank-big b {
  font-family: var(--font-num);
  font-size: 1.5em;
  color: var(--c-cyan);
  margin: 0 4px;
}

.rank-gap {
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--c-text-dim);
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   侧边实时排行榜
   ============================================================ */
#board {
  flex: 0 0 336px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  background: linear-gradient(180deg, rgba(12, 30, 50, 0.88) 0%, rgba(5, 14, 24, 0.92) 100%);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 20px 50px rgba(0, 6, 14, 0.55), inset 0 1px 0 rgba(120, 200, 255, 0.12);
  overflow: hidden;
}

.board-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--c-line-soft);
}
.board-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--c-cyan);
}
.board-round {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--c-text-dim);
}
.board-round b {
  font-family: var(--font-num);
  color: var(--c-white);
  font-size: 14px;
}

.board-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 10px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 208, 245, 0.3) transparent;
}
.board-list::-webkit-scrollbar { width: 7px; }
.board-list::-webkit-scrollbar-thumb {
  background: rgba(63, 208, 245, 0.3);
  border-radius: 99px;
}

.board-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-areas:
    "rank name score"
    "rank detail score";
  align-items: center;
  column-gap: 9px;
  row-gap: 1px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.028);
  transition: background 260ms, border-color 260ms, transform 260ms;
}

.bi-rank {
  grid-area: rank;
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  color: var(--c-text-dim);
}

.bi-name {
  grid-area: name;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bi-detail {
  grid-area: detail;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--c-text-dim);
  white-space: nowrap;
}
.bi-detail em {
  font-style: normal;
  color: var(--c-cyan-dim);
}

.bi-scores {
  grid-area: score;
  text-align: right;
  line-height: 1.15;
}
.bi-scores b {
  display: block;
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-white);
}
.bi-scores small {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: var(--c-text-dim);
}

/* 前三名 */
.board-item.rank-1 { background: rgba(255, 205, 80, 0.10); border-color: rgba(255, 205, 80, 0.34); }
.board-item.rank-1 .bi-rank { color: #ffd75e; }
.board-item.rank-2 { background: rgba(198, 220, 240, 0.075); border-color: rgba(198, 220, 240, 0.24); }
.board-item.rank-2 .bi-rank { color: #d7e6f5; }
.board-item.rank-3 { background: rgba(214, 152, 96, 0.085); border-color: rgba(214, 152, 96, 0.28); }
.board-item.rank-3 .bi-rank { color: #e0a86e; }

/* 当前出场的组 */
.board-item.is-turn {
  border-color: rgba(63, 208, 245, 0.75);
  background: rgba(63, 208, 245, 0.13);
  box-shadow: 0 0 0 1px rgba(63, 208, 245, 0.18), 0 0 22px rgba(63, 208, 245, 0.22);
}
.board-item.is-turn .bi-name { color: #ffffff; font-weight: 600; }
.board-item.is-turn .bi-name::after {
  content: "◀ 比划中";
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0;
  color: var(--c-cyan);
  animation: blink 1.4s ease-in-out infinite;
}

/* 名次变化高亮 */
.board-item.rank-up { animation: rankUp 760ms ease both; }
.board-item.rank-down { animation: rankDown 760ms ease both; }

.board-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 11px 12px 13px;
  border-top: 1px solid var(--c-line-soft);
  background: rgba(0, 0, 0, 0.18);
}

/* ============================================================
   浮层
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 7, 14, 0.78);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fadeIn 180ms ease both;
}

.overlay-card {
  width: min(100%, 480px);
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  background: linear-gradient(180deg, rgba(16, 38, 62, 0.97) 0%, rgba(6, 16, 28, 0.98) 100%);
  box-shadow: 0 30px 80px rgba(0, 4, 10, 0.75);
  padding: 26px 26px 22px;
  text-align: center;
  animation: popIn 220ms cubic-bezier(0.2, 1.2, 0.3, 1) both;
}

.overlay-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--c-white);
}

.overlay-card p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 1px;
  color: var(--c-text-dim);
}

.pause-word {
  font-size: 30px !important;
  font-weight: 800;
  letter-spacing: 8px !important;
  color: var(--c-cyan) !important;
  filter: blur(11px);
  user-select: none;
}

.overlay-tip {
  font-size: 12.5px !important;
  color: var(--c-text-dim) !important;
}

.overlay-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.overlay-actions.col { flex-direction: column; }
.overlay-actions.col .btn { width: 100%; }

.btn-danger.is-armed {
  background: var(--c-bad);
  color: #2a0404;
  border-color: var(--c-bad);
  animation: pulseRed2 0.9s ease-in-out infinite;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 90;
  transform: translate(-50%, 22px);
  padding: 11px 24px;
  border-radius: 99px;
  border: 1px solid var(--c-line);
  background: rgba(10, 26, 44, 0.94);
  color: var(--c-white);
  font-size: 14px;
  letter-spacing: 1.5px;
  box-shadow: 0 14px 40px rgba(0, 4, 10, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms, transform 220ms;
  white-space: nowrap;
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04080f;
  color: #f2f8ff;
  font-size: 18px;
  letter-spacing: 2px;
}

/* ============================================================
   动画
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes popTick {
  0%   { opacity: 0; transform: scale(1.42); }
  45%  { opacity: 1; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes wordIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes flashGood {
  0%   { transform: scale(1); color: #ffffff; }
  35%  { transform: scale(1.09); color: #9dffcd; text-shadow: 0 0 90px rgba(46, 224, 138, 0.95); }
  100% { transform: scale(1); color: #ffffff; }
}

@keyframes flashSkip {
  0%   { transform: translateX(0); }
  22%  { transform: translateX(-14px); color: #ffe0a6; }
  55%  { transform: translateX(10px); }
  100% { transform: translateX(0); }
}

@keyframes pulseRed {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.055); }
}

@keyframes pulseRed2 {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 93, 93, 0.55); }
  50%      { box-shadow: 0 0 0 9px rgba(255, 93, 93, 0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

@keyframes rankUp {
  0%   { transform: translateY(10px); background: rgba(46, 224, 138, 0.30); }
  100% { transform: translateY(0); }
}

@keyframes rankDown {
  0%   { transform: translateY(-10px); background: rgba(255, 93, 93, 0.24); }
  100% { transform: translateY(0); }
}

/* ============================================================
   响应式：窄屏 / 平板
   ============================================================ */
@media (max-width: 1180px) {
  #board { flex-basis: 292px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  html, body { overflow: auto; }
  /* 窄屏改回「内容撑高 + 页面滚动」：侧栏挪到下面，硬撑满视口会把内容挤坏 */
  #app { height: auto; min-height: 100vh; }
  .app-layer { height: auto; min-height: 100%; }
  .app-body { flex-direction: column; height: auto; padding: 0 14px 18px; }
  .app-main { min-height: 62vh; }
  #board { flex: 0 0 auto; max-height: none; }
  .board-list { max-height: 40vh; }
  #hud { flex-wrap: wrap; gap: 12px; padding: 12px 14px 10px; }
  .hud-mission { max-width: none; flex-basis: 100%; order: 3; margin-left: 0; }
  .hud-meta { margin-left: auto; }
  .panel { padding: 20px 18px 22px; }
  .module-list { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  .play-actions { grid-template-columns: 1fr 1fr; }
  .play-actions .btn-correct { grid-column: 1 / -1; }
  .timer-row { flex-direction: column; gap: 10px; }
  .timer { min-width: 0; }
  .timer-bar { width: 100%; }
}

@media (max-height: 640px) {
  .word-stage { min-height: 110px; }
  .setup-block { margin-bottom: 13px; }
}

/* 尊重系统的「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   音游式连击特效（FX 层）
   ------------------------------------------------------------
   设计约束（照验收来的，别改坏）：
     · 独立层：position:fixed + pointer-events:none + contain，特效怎么飞都不参与布局；
     · 只动 transform 与 opacity，不动 width/height/top/left（进度环的宽度由 CSS 变量一次定死）；
     · 粒子同时活跃节点 ≤12（JS 侧计数 + 回收）；
     · 连击大字 / 进度环 / 光环 / 粒子全部落在**词条矩形之外**：
       大字压在词条下沿 +36 px，粒子只朝下半个方向飞，光环圆心在数字底部；
     · 无答题瞬间特效层是空的（只剩常驻 COMBO 标记），不影响亮度 / 对比度指标；
     · prefers-reduced-motion: reduce 时降级为「只弹数字 + 淡出」。
   ============================================================ */

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
  contain: layout style paint;
}

/* ---------- 连击大字：三层残影 + 1.75 倍回弹 ---------- */
.fx-combo {
  position: fixed;
  /* 原点在顶部：1.75 倍回弹是**向下**长，永远不会顶进上方 36 px 处的词条框 */
  transform-origin: 50% 0%;
  font-family: var(--font-num);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform, opacity;
  animation: fxComboIn 700ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
/* 三档：3~5 青 44px / 6~9 绿 56px / 10+ 白偏青 68px */
.fx-combo[data-tier="0"] { font-size: 36px; color: #cfefff; }
.fx-combo[data-tier="1"] { font-size: 44px; color: #8ff0ff; }
.fx-combo[data-tier="2"] { font-size: 56px; color: #7dffc0; }
.fx-combo[data-tier="3"] { font-size: 68px; color: #f0ffff; }

.fx-combo-main {
  position: relative;
  display: block;
  text-shadow:
    0 0 3px rgba(1, 6, 14, 1),
    0 2px 7px rgba(2, 9, 18, 0.95),
    0 0 12px currentColor,
    0 0 24px currentColor;
}
/* 残影：同一个数字复制三份，越远越淡 */
.fx-combo-ghost {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
  text-shadow: none;
}
.fx-combo-ghost.g1 { transform: translateX(3px); opacity: 0.35; }
.fx-combo-ghost.g2 { transform: translateX(6px); opacity: 0.20; }
.fx-combo-ghost.g3 { transform: translateX(9px); opacity: 0.10; }

/* 进度环：绕在数字外圈的一圈细环（conic-gradient 画出已积累的比例） */
.fx-combo-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--h, 44px) * 1.35);
  height: calc(var(--h, 44px) * 1.35);
  margin: calc(var(--h, 44px) * -0.675) 0 0 calc(var(--h, 44px) * -0.675);
  border-radius: 50%;
  background: conic-gradient(currentColor calc(var(--p, 0) * 360deg),
              rgba(255, 255, 255, 0.12) 0);
  -webkit-mask: radial-gradient(closest-side, transparent 80%, #000 82%);
  mask: radial-gradient(closest-side, transparent 80%, #000 82%);
  opacity: 0.95;
  pointer-events: none;
}

/* ---------- 一次性爆发：粒子（短线，只朝下半个方向飞） ---------- */
.fx-particle {
  position: fixed;
  width: 4px;
  height: 22px;
  margin: -11px 0 0 -2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffffff 0%, currentColor 45%, rgba(255, 255, 255, 0) 100%);
  box-shadow: 0 0 3px rgba(1, 6, 14, 0.95), 0 0 12px currentColor;
  color: #7ee8ff;
  pointer-events: none;
  will-change: transform, opacity;
  animation: fxFly 400ms cubic-bezier(0.16, 0.72, 0.28, 1) both;
}
.fx-particle[data-tone="green"] { color: #7dffb4; }
.fx-particle[data-tone="white"] { color: #ffffff; }

/* ---------- 光环：从数字底部向外扩散 ---------- */
.fx-halo {
  position: fixed;
  width: 64px;
  height: 64px;
  margin: 0 0 0 -32px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-shadow: 0 0 14px currentColor, inset 0 0 14px currentColor;
  color: #7ee8ff;
  pointer-events: none;
  will-change: transform, opacity;
  animation: fxHalo 420ms cubic-bezier(0.18, 0.7, 0.3, 1) both;
}
.fx-halo[data-tone="green"] { color: #7dffb4; }
.fx-halo[data-tone="white"] { color: #d8f6ff; }

/* ---------- 屏幕边缘脉冲（音游打击感）：只有内阴影，中间完全透明 ---------- */
.fx-edge {
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 92px 8px rgba(63, 208, 245, 0.55);
  opacity: 0;
  will-change: opacity;
  animation: fxEdgePulse 200ms ease-out both;
}
.fx-edge[data-tone="green"] { box-shadow: inset 0 0 92px 8px rgba(46, 224, 138, 0.5); }
.fx-edge[data-tone="white"] { box-shadow: inset 0 0 100px 10px rgba(216, 246, 255, 0.5); }

/* ---------- 分数飘字 ---------- */
.fx-score {
  position: fixed;
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
  will-change: transform, opacity;
  animation: fxScore 720ms cubic-bezier(0.16, 0.9, 0.24, 1) both;
  text-shadow: 0 0 10px rgba(2, 9, 18, 0.9), 0 2px 8px rgba(2, 9, 18, 0.9);
}
.fx-score small {
  font-family: var(--font-sys);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0.92;
}
.fx-score[data-tier="0"] { color: #f2f8ff; }
.fx-score[data-tier="0"] small { color: rgba(242, 248, 255, 0.6); }
.fx-score[data-tier="1"] { color: var(--c-cyan); }
.fx-score[data-tier="1"] small { color: rgba(63, 208, 245, 0.85); }
.fx-score[data-tier="2"] { color: var(--c-good); }
.fx-score[data-tier="2"] small { color: rgba(46, 224, 138, 0.9); }

/* ---------- 常驻连击标记（combo ≥3 才出现） ---------- */
.fx-chip {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 14px 7px;
  border-radius: 99px;
  border: 1px solid rgba(63, 208, 245, 0.55);
  background: rgba(6, 20, 34, 0.55);
  box-shadow: 0 0 16px rgba(63, 208, 245, 0.28);
  opacity: 0;
  transform: translate(-50%, 0) scale(0.9);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
  will-change: transform, opacity;
}
.fx-chip.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.fx-chip.is-broken {
  animation: fxChipBreak 150ms ease both;
  border-color: rgba(143, 171, 196, 0.4);
  box-shadow: none;
}
.fx-chip-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--c-cyan);
  line-height: 1;
  white-space: nowrap;
}
.fx-chip-label i {
  font-style: normal;
  font-family: var(--font-sys);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(143, 171, 196, 0.9);
}
.fx-chip-bar {
  display: block;
  width: 84px;
  height: 3px;
  border-radius: 2px;
  background: rgba(96, 174, 232, 0.22);
  overflow: hidden;
}
.fx-chip-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-good));
  box-shadow: 0 0 8px rgba(63, 208, 245, 0.8);
  transition: width 220ms ease;
}

/* ---------- 结算页：最高连击 / 连击加成 ---------- */
.result-combo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 10px 18px;
  margin: 2px 0 4px;
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--c-cyan);
}
.result-combo b { font-size: 26px; color: var(--c-white); }
.result-combo span {
  font-family: var(--font-sys);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--c-good);
}
.result-combo[hidden] { display: none; }

/* ---------- 动画 ---------- */
/* 入场 240 ms 回弹到 1.0，停留到 78%，最后淡出（总 700 ms） */
@keyframes fxComboIn {
  0%   { transform: translate(-50%, 0) scale(1.75); opacity: 0; }
  34%  { transform: translate(-50%, 0) scale(1); opacity: 1; }
  46%  { transform: translate(-50%, 0) scale(1.05); }
  58%  { transform: translate(-50%, 0) scale(1); }
  78%  { transform: translate(-50%, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 0; }
}
@keyframes fxFly {
  0%   { transform: translate3d(0, 0, 0) rotate(var(--rot, 0deg)) scaleY(0.4); opacity: 0; }
  12%  { opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translate3d(var(--dx, 0px), var(--dy, -60px), 0) rotate(var(--rot, 0deg)) scaleY(1.5); opacity: 0; }
}
@keyframes fxHalo {
  0%   { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes fxEdgePulse {
  0%   { opacity: 0; }
  25%  { opacity: 0.9; }
  100% { opacity: 0; }
}
@keyframes fxScore {
  0%   { transform: translate(0, 8px) scale(0.7); opacity: 0; }
  16%  { transform: translate(0, 0) scale(1.12); opacity: 1; }
  32%  { transform: translate(0, -4px) scale(1); }
  62%  { opacity: 1; }
  100% { transform: translate(0, -22px) scale(1); opacity: 0; }
}
@keyframes fxChipBreak {
  0%   { transform: translate(-50%, 0) scale(1); }
  30%  { transform: translate(-52%, 0) scale(0.97); }
  60%  { transform: translate(-48%, 0) scale(0.97); }
  100% { transform: translate(-50%, 0) scale(1); opacity: 0; }
}

/* ---------- 尊重「减少动态效果」：降级为「数字变化 + 淡出」 ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-particle,
  .fx-halo,
  .fx-edge {
    display: none !important;
  }
  .fx-combo.is-static,
  .fx-score.is-static {
    animation: none !important;
    transform: translate(-50%, 0) !important;
    /* 降级也要保留暗描边，否则白字压在亮天空上等于看不见 */
    text-shadow:
      0 0 3px rgba(1, 6, 14, 1),
      0 2px 6px rgba(2, 9, 18, 0.95),
      0 0 12px currentColor !important;
  }
  .fx-score.is-static { transform: none !important; }
  .fx-combo.is-static.is-out,
  .fx-score.is-static.is-out {
    opacity: 0;
    transition: opacity 220ms linear !important;
  }
  .fx-combo-ring { display: none !important; }
  .fx-chip {
    transition: opacity 220ms linear !important;
    transform: translate(-50%, 0) !important;
  }
  .fx-chip.is-broken { animation: none !important; opacity: 0 !important; }
  .fx-chip-bar > i { transition: none !important; }
}
