* { box-sizing: border-box; user-select: none; -webkit-user-select: none; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: #000000; color: #ffffff;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Heiti SC", sans-serif;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}
canvas { display: block; width: 100%; height: 100%; }

/* 实心无描边大闪电 */
.bolt {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  fill: currentColor;
  stroke: none;
  flex-shrink: 0;
}

/* 常驻无底色无边框 HUD */
#hud {
  position: fixed; inset: 0; pointer-events: none; z-index: 8;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
  transition: transform 0.1s ease-out, color 0.2s ease, opacity 0.25s ease;
}
/* 成就面板铺开时，常驻信息退场——面板里不需要再看见倒计时和层名 */
body.ach-open #hud { opacity: 0; }
/* 开局只留标题和指引：HUD 与成就入口都等开始屏收起后再露出来 */
body.at-start #hud { opacity: 0; }
body.at-start #ach-btn { opacity: 0; pointer-events: none; }

/* 终极层纯白界面：全文字转黑 */
#hud.white-void { color: #000000; }
#hud.white-void .timer-box { color: #000000 !important; }
#hud.white-void .energy-box { color: #000000 !important; }
#hud.white-void #tier-era { color: rgba(0,0,0,0.55) !important; }
#hud.white-void #tier-name { color: #000000 !important; }
#hud.white-void #tier-scale { color: rgba(0,0,0,0.65) !important; }
#hud.white-void .progress-wrap { background: rgba(0,0,0,0.14); }
#hud.white-void #progress-fill { background-color: #000000 !important; }
#hud.white-void #speed-hint { color: rgba(0,0,0,0.45); }

/* 相对论生效：时间变慢，常驻信息压一层蓝 */
#hud.dilated .timer-box { color: #8ecbff; }
#hud.dilated #tier-name { text-shadow: 0 0 18px rgba(80, 140, 255, 0.65); }

.top-bar {
  display: flex; justify-content: space-between; align-items: center;
}
/* 速度够快时，时间与闪电被冲力掀翻：外层只管倾角，内层保留缩放 / 吸入 / 呼吸等原有变换
   旋转点压在内侧：外侧那一头翘起来，整块的边就切出一道斜角 */
.tilt { display: inline-flex; will-change: transform; }
.tilt-left { transform-origin: 100% 50%; }
.tilt-right { transform-origin: 0% 50%; }
.timer-box {
  font-size: 38px; font-weight: 900; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; color: #ffffff;
  line-height: 1; transition: transform 0.1s ease-out, color 0.2s ease;
}
.timer-box.urgent {
  color: #ff3b5c;
  animation: urgentPulse 0.35s infinite alternate ease-in-out;
}
.top-meta {
  display: flex; align-items: center;
  font-variant-numeric: tabular-nums;
}
.energy-box {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 20px; font-weight: 900; color: #ffd32a;
  transition: transform 0.1s ease-out, color 0.2s ease;
}
.energy-box .bolt {
  width: 1.35em;
  height: 1.35em;
}

.center-info {
  text-align: center; pointer-events: none; margin-top: auto;
  display: flex; flex-direction: column; align-items: center;
  transition: opacity 0.22s ease;
}
#tier-era {
  font-size: 12px; font-weight: 900; letter-spacing: 3px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
  transition: color 0.2s ease;
}
#tier-name {
  font-size: 34px; font-weight: 900; letter-spacing: 1px;
  margin: 0 0 2px; transition: transform 0.08s ease-out, color 0.2s ease;
  line-height: 1.15;
}
#tier-scale {
  font-size: 13px; font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s ease;
}

.progress-wrap {
  width: 100%; max-width: 240px; height: 7px; margin: 12px auto 0;
  background: rgba(255,255,255,0.12); border-radius: 4px; overflow: hidden;
  transition: background-color 0.2s ease;
}
#progress-fill {
  height: 100%; width: 0%; background: #ffffff;
  border-radius: 4px;
  transition: width 0.04s linear, background-color 0.2s;
}
/* 引力透镜：光被折射，进度条变成一条流动的彩虹（走 repeating 一格 119px，位移一格刚好无缝接上） */
#hud.lens-bar #progress-fill {
  background-image: repeating-linear-gradient(
    90deg,
    #ff4d6d 0px,
    #ffb84d 17px,
    #f9f871 34px,
    #4ade80 51px,
    #22d3ee 68px,
    #a78bfa 85px,
    #ff7ab6 102px,
    #ff4d6d 119px
  );
  background-size: 119px 100%;
  animation: lensBarFlow 2.2s linear infinite;
}
@keyframes lensBarFlow {
  from { background-position: 0 0; }
  to   { background-position: 119px 0; }
}
/* 纯白终极界面还是留一根黑条，白底上不飘彩虹 */
#hud.white-void #progress-fill {
  background-image: none !important;
  animation: none;
}
#speed-hint {
  font-size: 12px; font-weight: 900; letter-spacing: 1px;
  color: rgba(255,255,255,0.42);
  margin-top: 10px;
  transition: opacity 0.4s ease, color 0.2s ease;
}
#speed-hint.faded { opacity: 0; }

/* 无底色透明叠层（避开顶部与底部常驻信息）
   内容比屏幕高时能滚动：auto 上下留白 + panel 的 margin:auto 才不会被裁掉顶部 */
.overlay {
  position: fixed; inset: 0;
  background: transparent;
  display: flex; flex-direction: column; align-items: center;
  padding: 56px 22px 76px;
  z-index: 10; text-align: center;
  overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y;
  opacity: 1;
  transition: opacity 0.28s ease;
}
.overlay.hidden-fade {
  opacity: 0;
  pointer-events: none;
}
/* 开始面板内容少，照旧居中 */
#start-screen { justify-content: center; }
/* 结算面板的整块内容：有空间就居中，没空间就从顶部开始排、可滚动 */
.panel {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 360px;
  margin: auto 0;
}
/* 标题本身就是开始按钮：大字照旧，加指针手型和呼吸跳动 */
#game-title {
  background: transparent; border: none; box-shadow: none;
  font-family: inherit;
  font-size: 52px; font-weight: 900; letter-spacing: 2px;
  margin: 0 0 12px; color: #ffffff; line-height: 1.1;
  cursor: pointer;
  transform-origin: 50% 50%;
  animation: retryBreath 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  transition: opacity 0.15s;
}
#game-title:hover { opacity: 0.85; }
p.sub {
  color: rgba(255,255,255,0.5); font-size: 15px; font-weight: 900;
  line-height: 1.7; max-width: 300px; margin: 0;
}

/* 极简大字按钮（无底色无边框） */
.btn-word {
  background: transparent; border: none; box-shadow: none;
  color: #ffffff; padding: 8px 20px;
  font-size: 40px; font-weight: 900; letter-spacing: 4px;
  cursor: pointer;
  transition: transform 0.08s ease-out, opacity 0.15s;
}
.btn-word:hover { opacity: 0.8; }
.btn-word:active { transform: scale(0.92); opacity: 0.65; }

/* 「再次跃迁」：一次呼吸两拍，放大后回落，停一拍再来；字号比标题小一档 */
#btn-retry {
  font-size: 36px;
  transform-origin: 50% 50%;
  animation: retryBreath 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
/* 「再次跃迁」/标题/NEW 共用：一拍两下心跳，中间不留停顿，循环接得很紧 */
@keyframes retryBreath {
  0%        { transform: scale(1); }
  12%       { transform: scale(1.13); }
  24%       { transform: scale(1.01); }
  36%       { transform: scale(1.07); }
  50%       { transform: scale(1); }
  62%       { transform: scale(1.13); }
  74%       { transform: scale(1.01); }
  86%       { transform: scale(1.07); }
  100%      { transform: scale(1); }
}
/* 面板收着时别空转 */
#end-screen.hidden-fade #btn-retry { animation: none; }
#start-screen.hidden-fade #game-title { animation: none; }
/* 按下时立刻压回去，别跟脉动打架 */
#btn-retry:active { animation: none; transform: scale(0.92); }
#game-title:active { animation: none; transform: scale(0.92); }
@media (prefers-reduced-motion: reduce) {
  #btn-retry { animation: none; }
  #game-title { animation: none; }
}

/* 结算信息（大黑粗体、无底色） */
.result-block {
  width: 100%;
  margin-bottom: 20px;
}
#res-tier {
  font-size: 40px; font-weight: 900; line-height: 1.15;
}
/* 第二层：层号 + 尺度 + 闪电，等宽字体、拉开字距，读作「技术参数」 */
#res-scale {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 8px;
  font-size: 11px; font-weight: 900;
  color: rgba(255,255,255,0.46);
  letter-spacing: 1.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.res-sep { color: rgba(255,255,255,0.20); }
#res-gain {
  display: inline-flex; align-items: center; gap: 2px;
  color: #ffd32a; letter-spacing: 0.5px;
}
#res-gain .bolt { width: 1.1em; height: 1.1em; }
/* 核聚变的额外加成：轨道符号 + 数字，默认不显示，有加成才插进来 */
#res-fusion {
  display: none; align-items: center; gap: 4px;
  color: #ffa94d; letter-spacing: 0.5px;
}
#res-fusion .orbit {
  width: 1.25em; height: 1.25em;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  overflow: visible;
}
#res-fusion .orbit circle { fill: currentColor; stroke: none; }
#res-fusion .res-sep { color: rgba(255,255,255,0.20); margin-right: 3px; }
/* 第三层：注解，靠留白和字重退到正文之后 */
#res-desc {
  margin: 20px auto 0; padding: 0 8px;
  width: max-content; max-width: none;
  white-space: nowrap;
  font-size: 13px; font-weight: 400; line-height: 1.75;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.55);
}
/* 窄屏塞不下整句，恢复换行，别把字挤出屏幕 */
@media (max-width: 640px) {
  #res-desc { white-space: normal; width: auto; max-width: 300px; }
}

/* 三条数值强化：横向一排三格，名字在上、等级与价格在下 */
.upgrades {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  width: 100%; margin-bottom: 20px;
}
.up-btn {
  background: transparent; border: none; box-shadow: none;
  color: #ffffff; cursor: pointer;
  transition: transform 0.08s ease-out, opacity 0.15s;
}
.up-btn:not(:disabled):active { transform: scale(0.97); }
.up-btn:disabled { opacity: 0.62; cursor: not-allowed; }

/* 不画分隔线：靠留白和三档字号把三行分开 */
.upgrades .up-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: 100%; padding: 9px 2px 12px;
}

.up-title { font-size: 15px; font-weight: 900; color: #ffffff; }
.upgrades .up-title { flex: none; text-align: left; font-size: 13px; letter-spacing: 0.5px; }
.up-lv {
  font-size: 11px; font-weight: 900; color: rgba(255,255,255,0.40);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.5px; min-width: 36px; text-align: right;
}
.upgrades .up-lv { min-width: 0; text-align: left; font-size: 10.5px; }
.up-cost {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px;
  min-width: 64px;
  font-size: 14px; font-weight: 900; color: #ffd32a;
  font-variant-numeric: tabular-nums;
}
.upgrades .up-cost { min-width: 0; justify-content: flex-start; font-size: 13px; }
.up-btn:disabled .up-cost { color: rgba(255,255,255,0.45); }

/* 装置：两列价目表，名字在左、价格贴右，下面一行小注；不画线，靠行距分块 */
.up-special-wrap {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  width: 100%;
  margin-bottom: 24px;
}
.up-cell {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
/* 单独占一行的装置：右半边不留空位 */
.up-cell-wide { grid-column: 1 / -1; }
.up-special {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 8px 2px 7px;
}
.up-special .up-title { font-size: 14px; letter-spacing: 0.5px; }
.up-special .up-cost { min-width: 0; font-size: 13px; }
/* 买过的装置不再置灰，改成可点的开关 */
.up-special.on .cost-val { color: #2ed573; }
.up-special.off .cost-val { color: rgba(255,255,255,0.40); }
.up-special.off .up-title { opacity: 0.45; }
/* 无限：∞ / 0 都带闪电，符号放大加粗；买不起照旧走禁用态的灰，不单独提亮 */
#up-infinity.inf-mode #cost-infinity .bolt { width: 1.15em; height: 1.15em; }
#up-infinity.inf-mode #cost-infinity .cost-val {
  font-size: 20px; font-weight: 900; line-height: 1;
  font-family: "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
}
/* 成就锁：比一般买不起亮一些，让人看清要攒多少条 */
.up-special.locked { opacity: 0.62; }
.up-special.locked .cost-val { color: #a78bfa; }
/* 紫色锁头：跟着 locked 状态出现，亮价后自动收起 */
.lock-icon {
  display: none; flex: none;
  width: 1.1em; height: 1.1em;
  color: #a78bfa;
}
.up-special.locked .lock-icon { display: block; }
/* 按钮下面那行注释：一行说完，说不完就省略，不再往下堆字 */
.up-note {
  margin: 0; padding: 0 2px;
  font-size: 9.5px; font-weight: 500; line-height: 1.55;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.32);
  text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-special.on + .up-note { color: rgba(255,255,255,0.46); }
.relativity-text {
  background: linear-gradient(90deg, #1e90ff, #7fd0ff, #a29bfe, #1e90ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 3.4s linear infinite;
}
.horizon-text {
  background: linear-gradient(90deg, #00d2d3, #c8f7ff, #48dbfb, #00d2d3);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 3.0s linear infinite;
}
.lens-text {
  background: linear-gradient(90deg, #b8c6ff, #ffffff, #ffd6e7, #b8c6ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 3.8s linear infinite;
}
/* 真理：终端绿，冷、精确 —— 八个道具里唯一「没有温度」的颜色 */
.truth-text {
  background: linear-gradient(90deg, #0a8f3c, #b6ffcf, #2ed573, #0a8f3c);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 4.2s linear infinite;
}
/* 无限：最贵的一件，金白流光，跟结算闪电同一个色系 */
.infinity-text {
  background: linear-gradient(90deg, #b8860b, #fff6d5, #ffd32a, #b8860b);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 2.4s linear infinite;
}
/* 多元宇宙：紫粉青三色对开，像两面镜子互相映照 */
.kaleido-text {
  background: linear-gradient(90deg, #ff9ff3, #a29bfe, #7ef9ff, #ff9ff3);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 1.6s linear infinite;
}
.fusion-text {
  background: linear-gradient(90deg, #ff7a18, #ffd32a, #fff6d5, #ff7a18);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 1.9s linear infinite;
}
.fourthdim-text {
  background: linear-gradient(90deg, #ff6b81, #ffd6e7, #00f0ff, #ff6b81);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 3.2s linear infinite;
}
.rainbow-text {
  background: linear-gradient(90deg, #ff4757, #ffa502, #ffd32a, #2ed573, #1e90ff, #a29bfe, #ff4757);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 2.2s linear infinite;
}
@keyframes rainbowShift {
  to { background-position: 200% center; }
}

#flash {
  position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5;
}
/* 相对论：慢镜头黑边。高度由 hud.setLetterbox 按 state.dilated 逐帧给，不做过渡，让数值自己平滑 */
#bar-top, #bar-bottom {
  position: fixed; left: 0; right: 0; height: 0;
  background: #000; pointer-events: none; z-index: 6;
}
#bar-top { top: 0; }
#bar-bottom { bottom: 0; }
/* 收尾压黑：盖在 HUD 上、结算面板之下。cover 是慢慢变黑，松开是快速揭开露出商店 */
#blackout {
  position: fixed; inset: 0; background: #000;
  opacity: 0; pointer-events: none; z-index: 9;
  transition: opacity 0.5s ease;
}
#blackout.cover {
  opacity: 1;
  transition: opacity 1.3s ease-in;
}
@keyframes urgentPulse {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}

/* ========== 通用指引：大箭头 + 粗黑体 ========== */
#guide-layer {
  position: fixed; inset: 0;
  z-index: 13;
  pointer-events: none;
}
.guide {
  position: absolute;
  display: flex;
  animation: guideIn 0.32s ease both;
}
/* 文字和箭头装在一起，整块一起点动，整块也一起歪 */
.guide-inner { --tilt: -8deg; display: flex; }
.guide.v .guide-inner { flex-direction: column; align-items: center; gap: 4px; animation: guideBobY 1.1s ease-in-out infinite; }
.guide.h .guide-inner { flex-direction: row; align-items: center; gap: 4px; animation: guideBobX 1.1s ease-in-out infinite; }
.guide-text {
  font-size: clamp(20px, 5.4vw, 28px);
  font-weight: 900;
  letter-spacing: 2px;
  white-space: nowrap;
  /* 七色彩虹文字：底色裁进字形里，再慢慢流动 */
  background: linear-gradient(90deg, #ff4d6d, #ffb84d, #f9f871, #4ade80, #22d3ee, #a78bfa, #ff7ab6);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* 裁字之后 text-shadow 会糊在字形上，改用整体投影压一层暗底 */
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.95));
  animation: rainbowShift 3s linear infinite;
}
.guide-arrow {
  display: block; flex: none;
  width: 52px; height: 78px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}
/* 一整块裁出来的箭头：柄是一条等宽直杆，底下接实心三角，没有折角
   彩虹沿杆的方向铺满整条，色相流动，跟文字一样是「真彩虹」 */
.guide-arrow-shape {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(180deg, #ff4d6d, #ffb84d, #f9f871, #4ade80, #22d3ee, #a78bfa, #ff7ab6);
  background-size: 100% 100%;
  clip-path: polygon(
    40% 5%, 60% 5%,              /* 直杆顶端 */
    60% 56%,                     /* 直杆到底，不收窄 */
    86% 56%, 50% 96%, 14% 56%,   /* 三角头 */
    40% 56%                      /* 直杆另一边 */
  );
  transform: rotate(var(--rot, 0deg));
  animation: guideRainbowFlow 3s linear infinite;
}
@keyframes guideRainbowFlow {
  to { filter: hue-rotate(360deg); }
}
/* 整块带着倾斜角一起点动：位移在倾斜后的坐标系里走，等于顺着箭头的方向戳 */
@keyframes guideBobY {
  0%, 100% { transform: rotate(var(--tilt, 0deg)) translateY(0); }
  50%      { transform: rotate(var(--tilt, 0deg)) translateY(9px); }
}
@keyframes guideBobX {
  0%, 100% { transform: rotate(var(--tilt, 0deg)) translateX(0); }
  50%      { transform: rotate(var(--tilt, 0deg)) translateX(9px); }
}
@keyframes guideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== 成就 ========== */
/* 入口：菜单态左下角的一枚徽章，数字压在徽章正中；局内由 body.in-run 收走，开屏由 body.at-start 收走 */
#ach-btn {
  position: fixed; left: 22px;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 12;
  padding: 0; background: none; border: none; box-shadow: none;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.08s ease-out;
}
#ach-btn:active { transform: scale(0.92); }
#ach-btn.is-hidden { opacity: 0; pointer-events: none; }
/* 没通关之前整条入口不存在——成就系统是通关后的东西 */
#ach-btn.is-locked { opacity: 0; pointer-events: none; }
body.in-run #ach-btn { opacity: 0; pointer-events: none; }

/* 徽章：六边形勋章 + 双绶带 + 中心五角星，默认全灰，数字黄色压在星上 */
.ach-badge {
  position: relative;
  display: block;
  width: 76px; height: 76px;
}
.ach-medal { display: block; width: 100%; height: 100%; }
.m-ribbon { fill: #71717a; }
.m-body { fill: #a1a1aa; }
.m-star { fill: #52525b; }
/* 数字落在六边形正中的星上（64 格里的 y=25.5） */
.ach-count {
  position: absolute; left: 50%; top: 39.5%;
  transform: translate(-50%, -50%);
  font-size: 18px; font-weight: 900; letter-spacing: -0.5px;
  line-height: 1;
  color: #ffd32a;
  font-variant-numeric: tabular-nums;
}
/* 全解锁：勋章换成闪金，星压成暗金，黄数字照样压得住 */
.ach-badge.all .m-ribbon { fill: #8a6d1f; }
.ach-badge.all .m-body { fill: #ffd32a; animation: goldFlash 1.6s ease-in-out infinite; }
.ach-badge.all .m-star { fill: #3a2c00; }
@keyframes goldFlash {
  0%, 100% { fill: #ffd32a; }
  50%      { fill: #fff6d5; }
}
/* 面板标题的全解锁闪金 */
.ach-head h2.all {
  background: linear-gradient(90deg, #b8860b, #fff6d5, #ffd32a, #fff6d5, #b8860b);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 1.8s linear infinite;
}

/* 面板：标题 + 计数一行，下面是可滚的长列表，返回压在最底下 */
#ach-screen { z-index: 11; }
.ach-panel { max-width: 400px; }
.ach-head {
  width: 100%;
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 14px;
}
.ach-head h2 {
  margin: 0;
  font-size: 32px; font-weight: 900; letter-spacing: 4px;
}
/* 条数：大粗黑体，跟标题同一套字，只报已解锁的，不报总数 */
#ach-total {
  font-size: 30px; font-weight: 900; letter-spacing: 0;
  line-height: 1;
  color: #ffd32a;
}
.ach-list {
  width: 100%; text-align: left;
  max-height: 54vh;
  overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  scrollbar-width: none;
  /* 下沿淡出：列表被切断的地方不要硬切一刀 */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 28px), transparent 100%);
}
.ach-list::-webkit-scrollbar { display: none; }
.ach-row { display: flex; gap: 14px; align-items: baseline; padding: 12px 0; }
/* 阶数：大号粗黑体，跟名字共用一条基线 */
.ach-idx {
  flex: none; min-width: 34px;
  font-size: 21px; font-weight: 900; letter-spacing: -0.5px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.85);
}
.ach-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ach-name {
  font-size: 18px; font-weight: 900; letter-spacing: 0.5px;
  line-height: 1.2;
}
.ach-sub {
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.42);
}
/* 这一层是什么维度的注解，来自 config 的 desc */
.ach-desc {
  font-size: 12px; font-weight: 400; line-height: 1.65;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.36);
}
/* 没解锁的整行压到背景里：只剩一个问号 */
.ach-row.locked .ach-idx { color: rgba(255, 255, 255, 0.22); }
.ach-row.locked .ach-name { color: rgba(255, 255, 255, 0.22); }
#btn-ach-close {
  margin-top: 20px;
  font-size: 24px; letter-spacing: 3px;
}
/* 解锁的行能点：点开看这一层的形态 */
.ach-row:not(.locked) { cursor: pointer; }
.ach-row:not(.locked):active { opacity: 0.55; }

/* 层详情：盖住成就列表的黑底，只留这一层的图形和注解 */
#ach-detail {
  z-index: 13;
  background: rgba(0, 0, 0, 0.94);
}
.detail-panel { max-width: 420px; }
#detail-canvas {
  display: block;
  width: min(280px, 68vw);
  height: min(280px, 68vw);
  flex: none;
  margin-bottom: 4px;
}
#detail-name {
  font-size: 40px; font-weight: 900; letter-spacing: 2px;
  line-height: 1.2;
}
#detail-meta {
  margin-top: 8px;
  font-size: 14px; font-weight: 900; letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
}
#detail-desc {
  margin: 14px 0 4px;
  font-size: 14px; font-weight: 500; line-height: 1.8;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.66);
}
#btn-detail-close {
  margin-top: 18px;
  font-size: 24px; letter-spacing: 3px;
}

/* 新成就：不再弹 toast，只在结算标题旁边跳一个红色 NEW */
.res-title-line {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 7px;
}
.res-new {
  font-size: 30px; font-weight: 900; letter-spacing: 0;
  line-height: 1;
  color: #ff2b45;
  rotate: 14deg;              /* 倾斜走独立属性，免得被跳动动画的 transform 吃掉 */
  transform-origin: 50% 50%;
  animation: retryBreath 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.res-new.hidden { display: none; }
@media (prefers-reduced-motion: reduce) {
  .res-new { animation: none; }
}

/* 矮屏（手机横屏等）逐级收紧，别把结算块挤到要滚动 */
@media (max-height: 800px) {
  .overlay { padding: 44px 20px 68px; }
  #res-tier { font-size: 36px; }
  #res-desc { margin-top: 10px; line-height: 1.7; }
  .result-block { margin-bottom: 16px; }
  .upgrades .up-btn { padding: 5px 2px 6px; }
  .up-special { padding: 4px 2px 3px; }
  .up-special-wrap { gap: 10px 14px; margin-bottom: 16px; }
  .up-note { font-size: 9px; }
  .upgrades { margin-bottom: 14px; }
  .btn-word { font-size: 32px; }
  #btn-retry { font-size: 32px; }
  .res-new { font-size: 26px; }
  .ach-list { max-height: 48vh; }
  #btn-ach-close { font-size: 22px; margin-top: 14px; }
}
@media (max-height: 680px) {
  .overlay { padding: 36px 18px 60px; }
  #res-tier { font-size: 31px; margin-bottom: 5px; }
  #res-desc { font-size: 12px; line-height: 1.6; margin-top: 8px; }
  #res-desc::before { margin-bottom: 8px; }
  .result-block { margin-bottom: 12px; }
  .upgrades .up-btn { padding: 4px 2px 5px; }
  .up-title { font-size: 13.5px; }
  .up-special .up-title { font-size: 13px; }
  .up-special { padding: 3px 2px 2px; }
  .up-special-wrap { gap: 8px 12px; margin-bottom: 12px; }
  .up-note { font-size: 8.5px; line-height: 1.4; }
  .btn-word { font-size: 28px; }
  #btn-retry { font-size: 28px; }
  .res-new { font-size: 22px; }
  .ach-list { max-height: 44vh; }
  .ach-head h2 { font-size: 26px; }
  .ach-row { padding: 8px 0; }
  #btn-ach-close { font-size: 20px; margin-top: 12px; }
}


/* ========== 测试面板（?debug / F2） ========== */
#debug-panel {
  position: fixed; right: 10px; top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 8px 9px;
  background: rgba(10, 10, 14, 0.86);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
#debug-panel.hidden { display: none; }
.dbg-title {
  margin-bottom: 2px;
  font-size: 10px; font-weight: 900; letter-spacing: 3px;
  text-align: center;
  color: rgba(255, 255, 255, 0.38);
}
#debug-panel button {
  display: block;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.09);
  border: none; border-radius: 5px;
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px;
  text-align: left; white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.08s ease-out;
}
#debug-panel button:active { transform: scale(0.96); background: rgba(255, 255, 255, 0.22); }
/* 系统已经开着的时候，第一条变绿 */
#debug-panel button.on { color: #2ed573; background: rgba(46, 213, 115, 0.14); }
