/* ===== 夜鹭快跑 · 新中式玻璃拟态样式 ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;            /* 禁止滚动，首屏即玩 */
  background: #A8C5B8;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #F5F1E8;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;          /* 阻止移动端默认手势 */
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;              /* 适配移动端动态视口 */
  overflow: hidden;
  --charge-bar-bottom: 150px;
  --game-toast-bottom: 104px;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: none;
}

/* ===== 覆盖层 ===== */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 24px;
}

/* 暂停遮罩：全屏 overlay 不透传点击 → 点 HUD 按钮会被吞！
   解决方案：overlay 本身不拦截事件，只让中间面板拦截，
   这样 HUD(z15) / 视角设置(z16) 点暂停按钮/指南/视角滑块都能正常响应 */
#pause-screen {
  pointer-events: none;
}
#pause-screen .panel,
#pause-screen .panel * {
  pointer-events: auto;
}

.hidden { display: none !important; }

/* ===== 玻璃拟态基础 ===== */
.glass {
  background: rgba(40, 40, 45, 0.35);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(245, 241, 232, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.panel {
  border-radius: 22px;
  padding: 36px 40px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  animation: pop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ===== 标题 ===== */
.title {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #F5F1E8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 4px;
}
.title.small { font-size: 34px; letter-spacing: 12px; }

.death-cause {
  font-size: 18px;
  letter-spacing: 6px;
  color: #FF6B35;
  text-align: center;
  margin: 8px 0 18px;
  font-weight: 600;
}

.subtitle {
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(245, 241, 232, 0.55);
  margin-bottom: 26px;
}

/* ===== 操作提示 ===== */
.hints {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: rgba(245, 241, 232, 0.85);
}
.key {
  font-family: "Noto Sans SC", monospace;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(245, 241, 232, 0.12);
  border: 1px solid rgba(245, 241, 232, 0.2);
  color: #F5F1E8;
}

/* ===== 按钮 ===== */
.btn {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 4px;
  padding: 14px 36px;
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn.primary {
  color: #F5F1E8;
  background: linear-gradient(135deg, #C0392B 0%, #8B2A1F 100%);
  box-shadow: 0 6px 18px rgba(192, 57, 43, 0.4);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(192, 57, 43, 0.5); }
.btn.primary:active { transform: translateY(0); }

.btn.ghost {
  color: #F5F1E8;
  background: rgba(245, 241, 232, 0.08);
  border: 1px solid rgba(245, 241, 232, 0.25);
  box-shadow: none;
}
.btn.ghost:hover { transform: translateY(-2px); background: rgba(245, 241, 232, 0.14); }
.btn.ghost:active { transform: translateY(0); }

.btn.secondary {
  color: #F5F1E8;
  background: rgba(110, 198, 255, 0.18);
  border: 1px solid rgba(110, 198, 255, 0.4);
  box-shadow: 0 4px 14px rgba(110, 198, 255, 0.2);
  letter-spacing: 2px;
  padding: 12px 28px;
  font-size: 14px;
}
.btn.secondary:hover { transform: translateY(-2px); background: rgba(110, 198, 255, 0.28); }
.btn.secondary:active { transform: translateY(0); }

/* 危险按钮（重置进度等不可撤销操作） */
.btn.danger {
  color: #FFE9E6;
  background: linear-gradient(135deg, #8B0000 0%, #5C0000 100%);
  box-shadow: 0 6px 18px rgba(139, 0, 0, 0.45);
  letter-spacing: 2px;
  padding: 12px 28px;
  font-size: 14px;
  border: 1px solid rgba(255, 120, 100, 0.35);
}
.btn.danger:hover:not([disabled]) { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(139, 0, 0, 0.55); }
.btn.danger:active:not([disabled]) { transform: translateY(0); }
.btn.danger[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.3);
}

/* ===== 重置进度专用页（2026-08-03 需求 2） ===== */
.reset-panel {
  max-width: 520px;
  width: 100%;
  padding: 22px 22px 20px;
}
.reset-title {
  margin: 0 0 4px;
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #FFE9E6;
  text-align: center;
}
.reset-subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.6);
  text-align: center;
  letter-spacing: 2px;
}
.reset-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 120, 100, 0.2);
  border-radius: 12px;
}
.reset-list li {
  font-size: 13px;
  color: rgba(245, 241, 232, 0.88);
  padding: 5px 0;
  line-height: 1.55;
}
.reset-list b { color: #FFD27A; font-weight: 700; }

.reset-confirm-box {
  border: 1px dashed rgba(255, 120, 100, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(139, 0, 0, 0.08);
}
.reset-warn {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #FFB4A8;
}
.reset-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.92);
  user-select: none;
  margin: 0 0 12px;
}
.reset-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #C0392B;
  flex-shrink: 0;
}
.reset-btns {
  margin-top: 4px !important;
}

/* 重置结果展示 */
.reset-result {
  text-align: center;
  padding: 10px 4px 4px;
}
.reset-result-icon {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 8px;
}
.reset-result-title {
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #F5F1E8;
  margin-bottom: 6px;
}
.reset-result-title.ok  { color: #8BC34A; }
.reset-result-title.err { color: #FF6B6B; }
.reset-result-desc {
  font-size: 13px;
  color: rgba(245, 241, 232, 0.72);
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 0 8px;
}

/* 开始页按钮行（开始奔跑 + 引导） */
.start-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

/* ===== 新手引导面板 ===== */
.guide-panel {
  max-width: 420px;
  width: min(92vw, 420px);
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
}
.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.guide-title {
  font-family: "Noto Serif SC", serif;
  font-size: 19px;
  letter-spacing: 3px;
  color: #F5F1E8;
  margin: 0;
  font-weight: 700;
}
.guide-step {
  font-family: "Noto Sans SC", monospace;
  font-size: 12px;
  color: rgba(245, 241, 232, 0.55);
  background: rgba(245, 241, 232, 0.08);
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* 页面容器（只显示 active 一页） */
.guide-pages {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 310px;
  min-width: 0;
}
.guide-page {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}
.guide-page.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.guide-page.prev {
  transform: translateX(-28px);
}

/* 每页元素 */
.guide-illustration {
  font-size: 40px;
  text-align: center;
  line-height: 1;
  margin: 2px 0 0;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25));
  flex-shrink: 0;
}
.guide-page-title {
  font-family: "Noto Serif SC", serif;
  font-size: 17px;
  letter-spacing: 2.5px;
  color: #FFD27A;
  margin: 0;
  text-align: center;
  font-weight: 700;
  flex-shrink: 0;
}
.guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: rgba(245, 241, 232, 0.92);
  font-size: 13px;
  line-height: 1.5;
}
.guide-list.compact {
  gap: 6px;
  font-size: 12.5px;
}
.guide-list li {
  padding: 7px 10px;
  background: rgba(245, 241, 232, 0.05);
  border-radius: 9px;
  border: 1px solid rgba(245, 241, 232, 0.08);
  word-break: break-word;
}
.guide-tip {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.55;
  color: #FFE4A8;
  background: rgba(255, 210, 122, 0.08);
  padding: 7px 10px;
  border-radius: 9px;
  border-left: 2.5px solid #FFD27A;
  text-align: left;
  flex-shrink: 0;
  word-break: break-word;
}

/* 小标签（操作） */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  margin-right: 5px;
  border-radius: 7px;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 11px;
  vertical-align: middle;
  background: rgba(192, 57, 43, 0.35);
  border: 1px solid rgba(255, 107, 53, 0.5);
  color: #FFD27A;
  flex-shrink: 0;
}
.tag-jump { background: rgba(192, 57, 43, 0.35); }
.tag-crouch { background: rgba(110, 198, 255, 0.18); border-color: rgba(110, 198, 255, 0.4); color: #BDE6FF; }
.tag-dir { background: rgba(245, 241, 232, 0.12); border-color: rgba(245, 241, 232, 0.25); color: #F5F1E8; letter-spacing: 0.5px; }
.tag-pause { background: rgba(245, 241, 232, 0.12); border-color: rgba(245, 241, 232, 0.25); color: #F5F1E8; }
.tag-dye { background: rgba(255, 107, 53, 0.4); border-color: rgba(255, 215, 0, 0.6); color: #FFD700; }

/* 卡片（障碍物/消耗品对比） */
.guide-cards {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  flex: 1;
  min-height: 0;
}
.guide-card {
  flex: 1;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(245, 241, 232, 0.12);
  background: rgba(40, 40, 45, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}
.guide-card-icon { font-size: 28px; line-height: 1; }
.guide-card-name {
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: #F5F1E8;
}
.guide-card-desc {
  font-size: 10.5px;
  line-height: 1.5;
  color: rgba(245, 241, 232, 0.72);
  word-break: break-word;
}
.card-glass { border-color: rgba(170, 221, 238, 0.35); background: rgba(170, 221, 238, 0.06); }
.card-trash { border-color: rgba(100, 120, 80, 0.5); background: rgba(90, 110, 70, 0.1); }
.card-dash  { border-color: rgba(255, 210, 122, 0.5); background: rgba(255, 193, 7, 0.07); }
.card-shield{ border-color: rgba(110, 198, 255, 0.5); background: rgba(110, 198, 255, 0.07); }
.cause-bird  { color: #FF9F87; font-size: 10.5px; margin-top: 1px; display: block; line-height: 1.4; }
.cause-trash { color: #A2D199; font-size: 10.5px; margin-top: 1px; display: block; line-height: 1.4; }

/* 窄屏（手机竖屏）：3 列障碍卡片的文字略小化 */
@media (max-width: 420px) {
  .guide-cards { gap: 5px; }
  .guide-card { padding: 8px 4px; gap: 3px; }
  .guide-card-icon { font-size: 22px; }
  .guide-card-name { font-size: 11.5px; letter-spacing: 1px; }
  .guide-card-desc, .cause-bird, .cause-trash { font-size: 9.5px; line-height: 1.4; }
}

/* 染色演示：染色前 vs 染色后 */
.guide-dye-demo {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  margin: 3px 0 1px;
  flex-shrink: 0;
}
.dye-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.dye-label {
  font-size: 11.5px;
  color: rgba(245, 241, 232, 0.55);
  letter-spacing: 2px;
}
.glass-block {
  width: 100%;
  height: 54px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}
.glass-block.invisible {
  background: rgba(170, 221, 238, 0.06);
  border: 1px dashed rgba(170, 221, 238, 0.22);
  color: rgba(245, 241, 232, 0.3);
}
.glass-block.visible {
  background: rgba(255, 107, 53, 0.55);
  border: 1px solid rgba(255, 215, 0, 0.7);
  color: #000;
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.5);
}
.dye-arrow {
  font-size: 20px;
  color: #FFD27A;
  font-weight: 700;
  align-self: center;
  flex-shrink: 0;
}

/* 翻页圆点 */
.guide-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 10px 0 9px;
  flex-shrink: 0;
}
.guide-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(245, 241, 232, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}
.guide-dot.active {
  width: 20px;
  border-radius: 4px;
  background: #FFD27A;
  box-shadow: 0 0 7px rgba(255, 210, 122, 0.5);
}

/* 底部按钮：上一步 / 下一步 / 跳过 */
.guide-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guide-actions .btn {
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 1.5px;
  min-height: 36px;
}
.guide-actions .btn.secondary {
  margin-left: auto;
  padding: 8px 13px;
  font-size: 12px;
  letter-spacing: 1px;
}

/* 按钮行：恢复 / 结束 并排 */
.btn-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 8px;
}

/* ===== HUD ===== */
#hud {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 22px;
  z-index: 15;   /* 原 5 → 15：高于 .overlay(z 10)，暂停时暂停按钮、指南和音量依然可点 */
  pointer-events: none;
  gap: 12px;
}
.score-box {
  border-radius: 14px;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 84px;
}
.score-box.right { align-items: flex-end; }
.score-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(245, 241, 232, 0.6);
}
.score-value {
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 700;
  color: #F5F1E8;
  line-height: 1.1;
}
.score-value.flash { animation: flash 0.4s ease; }
@keyframes flash {
  0%   { color: #C0392B; transform: scale(1.18); }
  100% { color: #F5F1E8; transform: scale(1); }
}

/* HUD 左侧容器：分数 + 洗手液计数垂直排列 */
.hud-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  min-width: 0;
  flex-shrink: 1;
}

/* HUD 右侧容器：功能按钮 + 最佳分数垂直排列
   —— 避免原先 3 列横向挤压导致按钮被压缩或最佳分数超出边界 */
.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  min-width: 0;
  flex-shrink: 0;
}

/* 小屏（< 380px）按钮进一步缩小，更不占空间 */
@media (max-width: 380px) {
  .hud-right { gap: 5px; }
  #hud { padding: 0 12px; top: 10px; gap: 6px; }
  .score-box { padding: 5px 10px; min-width: 64px; }
  .score-value { font-size: 18px; }
  .score-label { font-size: 9px; letter-spacing: 2px; }
  .soap-count { font-size: 14px; }
  .tbtn-pause { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
  .hud-buttons { gap: 5px; }
  .consumables-panel { top: 140px; right: 8px; gap: 6px; }
  .tbtn-consume { width: 52px; height: 54px; border-radius: 13px; }
  .tbtn-consume .consume-icon  { font-size: 13px; }
  .tbtn-consume .consume-label { font-size: 10px; }
  .tbtn-consume .consume-cost  { font-size: 8px; }
}

/* 洗手液计数小框 */
.soap-box {
  border-radius: 12px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 60px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.soap-icon {
  font-size: 16px;
  line-height: 1;
}
.soap-count {
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  font-weight: 700;
  color: #F5F1E8;
  line-height: 1.2;
}

/* 结算界面洗手液行 */
.result-row.soap-row span:first-child {
  color: rgba(245, 241, 232, 0.7);
  font-size: 14px;
}

/* 视角切换按钮 */
.fov-btn {
  cursor: pointer;
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #F5F1E8;
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  pointer-events: auto;
  transition: transform 0.15s ease;
}
.fov-btn:hover { transform: translateY(-2px); }
.fov-btn:active { transform: translateY(0); }
.fov-icon {
  font-size: 12px;
  opacity: 0.7;
}

/* 视角切换按钮 */
.view-btn {
  cursor: pointer;
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #F5F1E8;
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  pointer-events: auto;
  transition: transform 0.15s ease;
}
.view-btn:hover { transform: translateY(-2px); }
.view-btn:active { transform: translateY(0); }
.view-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ===== 结算 ===== */
.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0 28px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: rgba(245, 241, 232, 0.8);
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(245, 241, 232, 0.12);
}
.result-row .score-value { font-size: 22px; }

/* ===== 加载 ===== */
#loading .panel { padding: 30px 40px; }
.spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 14px;
  border: 3px solid rgba(245, 241, 232, 0.2);
  border-top-color: #C0392B;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(245, 241, 232, 0.8);
}

/* ===== 蓄力条 ===== */
#charge-bar {
  position: absolute;
  bottom: var(--charge-bar-bottom);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 300px;
  max-width: 80vw;
  text-align: center;
  pointer-events: none;
}
.charge-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(245, 241, 232, 0.75);
  margin-bottom: 6px;
}
.charge-hint {
  font-size: 10px;
  opacity: 0.5;
}
.charge-track {
  width: 100%;
  height: 14px;
  background: rgba(40, 40, 45, 0.45);
  border: 1px solid rgba(245, 241, 232, 0.2);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.charge-fill {
  height: 100%;
  width: 0%;
  border-radius: 7px;
  background: linear-gradient(90deg, #5B8C8A 0%, #7ECDB8 50%, #FFD700 100%);
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(126, 205, 184, 0.5);
}
.charge-fill.ready {
  background: linear-gradient(90deg, #FF6B35 0%, #FFD700 50%, #FF3300 100%);
  animation: chargeReady 0.8s ease-in-out infinite;
}
@keyframes chargeReady {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 107, 53, 0.6); }
  50% { box-shadow: 0 0 24px rgba(255, 107, 53, 1.0); }
}

/* ===== 触控按钮 ===== */
#touch-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 7;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 16px 20px;
  pointer-events: none;
}

.ctrl-left, .ctrl-right {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.ctrl-right {
  flex-direction: column;
  gap: 10px;
}

/* 触控按钮基础样式 */
.tbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 241, 232, 0.25);
  border-radius: 50%;
  background: rgba(40, 40, 45, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #F5F1E8;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, background 0.08s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.tbtn:active {
  transform: scale(0.92);
  background: rgba(192, 57, 43, 0.5);
  border-color: rgba(255, 107, 53, 0.6);
}

/* 方向按钮 */
.tbtn-dir {
  width: 56px;
  height: 56px;
  font-size: 26px;
}

/* 跳跃按钮（最大，主操作） */
.tbtn-jump {
  width: 72px;
  height: 72px;
  font-size: 22px;
  background: rgba(192, 57, 43, 0.35);
  border-color: rgba(255, 107, 53, 0.4);
}

/* 下蹲按钮 */
.tbtn-crouch {
  width: 60px;
  height: 60px;
  font-size: 20px;
}

/* 染色按钮（蓄力满时显示） */
.tbtn-dye {
  width: 56px;
  height: 56px;
  font-size: 20px;
  background: rgba(255, 107, 53, 0.4);
  border-color: rgba(255, 215, 0, 0.6);
  color: #FFD700;
  animation: dyePulse 0.8s ease-in-out infinite;
}
@keyframes dyePulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 107, 53, 0.9);
    transform: scale(1.06);
  }
}

/* 右上角消耗品面板 */
.consumables-panel {
  position: absolute;
  top: 152px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 8;
  pointer-events: auto;
}

/* 消耗品按钮（HUD 内较小，带图标+标签+消耗；
   统一防止文字溢出按钮边界，小屏清晰可读） */
.tbtn-consume {
  width: 56px;
  height: 58px;
  border-radius: 15px;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  position: relative;
  font-size: 11px;
  line-height: 1;
  padding: 4px 2px;
  overflow: hidden;
  box-sizing: border-box;
}
.tbtn-consume .consume-icon {
  font-size: 15px;
  line-height: 1;
  margin-bottom: 1px;
}
.tbtn-consume .consume-label {
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 11px;
  margin: 0 0 1px;
  white-space: nowrap;
  letter-spacing: 1px;
}
.tbtn-consume .consume-cost {
  font-size: 8.5px;
  color: rgba(245, 241, 232, 0.7);
  font-weight: 400;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.tbtn-consume.dash {
  background: rgba(255, 193, 7, 0.2);
  border-color: rgba(255, 210, 122, 0.5);
}
.tbtn-consume.dash:active {
  background: rgba(255, 193, 7, 0.5);
  border-color: rgba(255, 210, 122, 0.8);
}
.tbtn-consume.shield {
  background: rgba(110, 198, 255, 0.15);
  border-color: rgba(110, 198, 255, 0.45);
}
.tbtn-consume.shield:active {
  background: rgba(110, 198, 255, 0.4);
  border-color: rgba(110, 198, 255, 0.8);
}
/* 洗手液不足时按钮灰掉 */
.tbtn-consume.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* 护盾数量徽章（右上角小红点样式） */
.shield-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #6EC6FF;
  color: #0a1628;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  font-family: "Noto Serif SC", sans-serif;
}

/* 冲刺全屏闪光（白色径向渐入渐出） */
.dash-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: radial-gradient(ellipse at center, rgba(255,230,180,0) 0%, rgba(255,200,100,0) 100%);
  opacity: 0;
  transition: opacity 0.1s ease-out;
}
.dash-flash.show {
  animation: dashFlash 0.4s ease-out forwards;
}
@keyframes dashFlash {
  0%   { background: radial-gradient(ellipse at center, rgba(255,240,200,0.7) 0%, rgba(255,180,80,0.2) 60%, rgba(255,150,50,0) 100%); opacity: 1; }
  100% { background: radial-gradient(ellipse at center, rgba(255,230,180,0) 0%, rgba(255,200,100,0) 100%); opacity: 0; }
}

/* 暂停/帮助/声音/设置 按钮（HUD 内）——
   之前 4 个按钮+最佳分数同一行挤爆，现在在 hud-right 纵向栏，稍微缩小节省空间 */
.tbtn-pause {
  width: 36px;
  height: 36px;
  font-size: 16px;
  border-radius: 11px;
  pointer-events: auto;
  flex-shrink: 0;
}

/* HUD 按钮组 */
.hud-buttons {
  display: flex;
  gap: 6px;
  pointer-events: auto;
  flex-wrap: nowrap;
  align-items: center;
}

/* 开发者署名 */
.credits {
  margin: 16px 0 20px;
  text-align: center;
  font-size: 12px;
  color: rgba(245, 241, 232, 0.5);
  line-height: 1.8;
  letter-spacing: 1px;
}
.credits p { margin: 0; }

/* 游戏设置面板 */
#view-settings {
  position: absolute;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;   /* 原 8 → 16：高于 HUD(z 15) 与 .overlay(z 10)，暂停时仍可拖动滑块调视角 */
  pointer-events: auto;
}
.settings-panel {
  padding: 14px 20px;
  min-width: 260px;
  max-width: 80vw;
}
.settings-title {
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
  font-weight: 600;
  color: #F5F1E8;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.setting-row label {
  font-size: 13px;
  color: rgba(245, 241, 232, 0.7);
  width: 58px;
  flex-shrink: 0;
}
.setting-row input[type="range"] {
  flex: 1;
  height: 28px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.setting-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(245, 241, 232, 0.2);
}
.setting-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #C0392B;
  border: 2px solid #F5F1E8;
  margin-top: -8px;
}
.setting-row input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(245, 241, 232, 0.2);
}
.setting-row input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #C0392B;
  border: 2px solid #F5F1E8;
}
.setting-value {
  font-family: "Noto Serif SC", serif;
  font-size: 14px;
  font-weight: 600;
  color: #F5F1E8;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}
.btn.small {
  padding: 6px 20px;
  font-size: 13px;
  margin-top: 4px;
  width: 100%;
}

/* ===== 分数弹跳动画 ===== */
@keyframes scoreBump {
  0% { transform: scale(1); }
  40% { transform: scale(var(--score-pop, 1.25)); color: #FFD27A;
        text-shadow: 0 0 14px rgba(255,210,122,0.45); }
  100% { transform: scale(1); text-shadow: none; }
}
.score-value.bump {
  animation: scoreBump 0.32s cubic-bezier(.22,.95,.3,1.2);
  will-change: transform;
}

/* ===== 统一游戏提示：蓄力槽下方、触控按钮上方 ===== */
.game-toast {
  --toast-anchor-x: -50%;
  position: absolute;
  bottom: var(--game-toast-bottom);
  left: 50%;
  transform: translateX(var(--toast-anchor-x));
  z-index: 8;
  width: max-content;
  max-width: calc(100vw - 32px);
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid rgba(245, 241, 232, 0.28);
  border-radius: 999px;
  background: rgba(18, 35, 38, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #F5F1E8;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
}
.game-toast.toast-standard {
  border-color: rgba(245, 241, 232, 0.3);
}
.game-toast.toast-combo {
  border: 1px solid rgba(127, 255, 212, 0.55);
  background: rgba(12, 45, 48, 0.82);
  color: #E8FFF7;
  box-shadow: 0 0 18px rgba(127, 255, 212, 0.28);
}
.game-toast.toast-milestone {
  border-color: rgba(255, 210, 122, 0.58);
  background: rgba(54, 38, 20, 0.86);
  color: #FFD27A;
  font-size: 20px;
  letter-spacing: 3px;
  box-shadow: 0 0 18px rgba(255, 180, 75, 0.26);
}
.game-toast.show {
  animation: gameToastIn var(--toast-duration, 1200ms) ease-out forwards;
}
@keyframes gameToastIn {
  0% { opacity: 0; transform: translateX(var(--toast-anchor-x)) translateY(7px) scale(0.96); }
  18%, 72% { opacity: 1; transform: translateX(var(--toast-anchor-x)) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(var(--toast-anchor-x)) translateY(5px) scale(0.98); }
}
@media (max-width: 375px) {
  .game-toast {
    --toast-anchor-x: 0%;
    left: 12px;
    right: 96px;
    width: auto;
    max-width: none;
    padding: 7px 10px;
    font-size: 12px;
  }
  .game-toast.toast-milestone { font-size: 18px; letter-spacing: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-toast.show { animation-name: gameToastFade; }
  @keyframes gameToastFade {
    0%, 100% { opacity: 0; transform: translateX(var(--toast-anchor-x)); }
    12%, 82% { opacity: 1; transform: translateX(var(--toast-anchor-x)); }
  }
}

/* ===== 无敌光环（屏幕边缘发光） ===== */
.invincible-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 5;
  box-shadow: inset 0 0 60px 20px rgba(255, 255, 255, 0.25),
              inset 0 0 120px 40px rgba(255, 215, 0, 0.15);
  animation: invinciblePulse 0.8s ease-in-out infinite;
}
@keyframes invinciblePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}



.gameover-actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px;
}
.gameover-actions .btn { margin: 0; }
/* 开始屏按钮区 */
.start-buttons {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 10px;
}
.start-buttons .btn { margin: 0; }

/* ===== 青瓷夜色 · 游玩界面视觉层 =====
   仅调整 HUD 与触控控件，不改变原有 DOM id、输入绑定或游戏逻辑。 */
#app {
  --night-ink: #071C1D;
  --night-ink-soft: rgba(7, 28, 29, 0.76);
  --celadon-surface: rgba(20, 55, 54, 0.68);
  --celadon-surface-soft: rgba(31, 70, 67, 0.48);
  --celadon-line: rgba(210, 235, 222, 0.28);
  --celadon-highlight: rgba(240, 250, 242, 0.18);
  --moon-white: #F4F1E8;
  --jade: #84D2BC;
  --jade-deep: #4D9F91;
  --warm-gold: #EECF7A;
  --cinnabar: #C85A42;
  --sky-jade: #83C8D2;
  --control-shadow: 0 10px 28px rgba(3, 18, 19, 0.3);
  --charge-bar-bottom: calc(170px + env(safe-area-inset-bottom, 0px));
  --game-toast-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}

.ui-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.ui-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* 顶部信息层 */
#hud {
  top: max(10px, env(safe-area-inset-top, 0px));
  padding: 0 max(12px, env(safe-area-inset-left, 0px));
  gap: 10px;
}
#hud .score-box,
#hud .soap-box,
.hud-buttons,
.consumables-panel,
#charge-bar {
  border: 1px solid var(--celadon-line);
  background:
    linear-gradient(145deg, var(--celadon-highlight), transparent 42%),
    var(--night-ink-soft);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: var(--control-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hud-left {
  gap: 6px;
  min-width: 96px;
}
#hud .score-box {
  min-width: 86px;
  padding: 7px 12px 8px;
  border-radius: 16px;
}
.hud-left .score-box {
  border-left: 2px solid var(--jade);
}
.score-label {
  color: rgba(244, 241, 232, 0.72);
  font-size: 9px;
  letter-spacing: 2.5px;
  line-height: 1.3;
}
.score-value {
  color: var(--moon-white);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.hud-right {
  gap: 6px;
}
.hud-right .score-box {
  min-width: 76px;
  padding: 5px 11px 6px;
  border-right: 2px solid rgba(238, 207, 122, 0.72);
}
.hud-right .score-value {
  color: var(--warm-gold);
  font-size: 19px;
}
.soap-box {
  min-width: 96px;
  min-height: 34px;
  padding: 5px 9px;
  gap: 5px;
  border-radius: 14px;
}
.soap-icon {
  width: 16px;
  height: 16px;
  color: var(--jade);
}
.soap-label {
  font-size: 9px;
  letter-spacing: 0.5px;
  color: rgba(244, 241, 232, 0.66);
}
.soap-count {
  margin-left: auto;
  color: var(--moon-white);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* 顶部功能按钮：统一线性图标与触控尺寸 */
.hud-buttons {
  gap: 8px;
  padding: 4px;
  border-radius: 18px;
  pointer-events: auto;
}
.tbtn-pause {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  color: rgba(244, 241, 232, 0.88);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.tbtn-pause .ui-icon {
  width: 20px;
  height: 20px;
}
.tbtn-pause:hover {
  color: var(--moon-white);
  background: rgba(132, 210, 188, 0.12);
}
.tbtn-pause:active {
  background: rgba(132, 210, 188, 0.24);
  border-color: rgba(132, 210, 188, 0.32);
}
.sound-off { display: none; }
.tbtn-pause.is-muted .sound-on { display: none; }
.tbtn-pause.is-muted .sound-off { display: block; }
.tbtn-pause.is-muted { color: var(--warm-gold); }

/* 通用触控材质 */
.tbtn {
  color: var(--moon-white);
  border-color: var(--celadon-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 44%),
    var(--celadon-surface);
  backdrop-filter: blur(12px) saturate(1.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
  box-shadow: var(--control-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 100ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.tbtn:focus-visible,
.btn:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--warm-gold);
  outline-offset: 3px;
}
.tbtn:active {
  transform: scale(0.94);
  background-color: rgba(42, 92, 84, 0.86);
  border-color: rgba(238, 207, 122, 0.62);
  box-shadow: 0 5px 14px rgba(3, 18, 19, 0.34), inset 0 1px 0 rgba(255,255,255,0.12);
}

/* 底部操作区：位置与输入方式不变，只统一材质与安全区 */
#touch-controls {
  padding:
    0
    max(14px, env(safe-area-inset-right, 0px))
    max(18px, env(safe-area-inset-bottom, 0px))
    max(14px, env(safe-area-inset-left, 0px));
}
.ctrl-left {
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--celadon-line);
  border-radius: 24px;
  background: rgba(7, 28, 29, 0.58);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: var(--control-shadow), inset 0 1px 0 rgba(255,255,255,0.07);
}
.tbtn-dir {
  width: 56px;
  height: 56px;
  border-radius: 19px;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 25px;
  background: rgba(50, 89, 84, 0.42);
  box-shadow: none;
}
.ctrl-right { gap: 10px; }
.tbtn-jump {
  width: 74px;
  height: 74px;
  border-radius: 25px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.18), transparent 44%),
    rgba(159, 69, 50, 0.78);
  border-color: rgba(238, 207, 122, 0.54);
  color: #FFF7E8;
  box-shadow: 0 12px 30px rgba(70, 27, 20, 0.34), inset 0 1px 0 rgba(255,255,255,0.16);
}
.tbtn-crouch {
  width: 62px;
  height: 62px;
  border-radius: 21px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.14), transparent 44%),
    rgba(34, 76, 73, 0.76);
}
.tbtn-dye {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  color: #FFF2B9;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.2), transparent 44%),
    rgba(164, 78, 44, 0.84);
  border-color: rgba(238, 207, 122, 0.72);
}

/* 消耗品侧栏：缩小视觉权重，保留清晰费用与状态 */
.consumables-panel {
  top: calc(146px + env(safe-area-inset-top, 0px));
  right: max(9px, env(safe-area-inset-right, 0px));
  gap: 8px;
  padding: 5px;
  border-radius: 21px;
}
.tbtn-consume {
  width: 54px;
  height: 62px;
  border-radius: 17px;
  padding: 5px 2px;
  gap: 1px;
  box-shadow: none;
}
.tbtn-consume .consume-icon {
  width: 17px;
  height: 17px;
  margin-bottom: 1px;
}
.tbtn-consume .consume-label {
  font-size: 12px;
  color: var(--moon-white);
}
.tbtn-consume .consume-cost {
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
  color: rgba(244, 241, 232, 0.66);
  letter-spacing: 0;
}
.tbtn-consume.dash {
  color: var(--warm-gold);
  background: rgba(105, 76, 25, 0.42);
  border-color: rgba(238, 207, 122, 0.4);
}
.tbtn-consume.shield {
  color: var(--sky-jade);
  background: rgba(30, 79, 83, 0.44);
  border-color: rgba(131, 200, 210, 0.42);
}
.tbtn-consume.disabled,
.tbtn-consume:disabled {
  opacity: 0.42;
  filter: saturate(0.45);
  cursor: not-allowed;
  pointer-events: none;
}
.shield-badge {
  top: -3px;
  right: -3px;
  background: var(--sky-jade);
  color: var(--night-ink);
  border: 1px solid rgba(244, 241, 232, 0.65);
}

/* 蓄力仪表与提示槽 */
#charge-bar {
  width: min(300px, calc(100vw - 48px));
  max-width: none;
  padding: 8px 11px 10px;
  border-radius: 17px;
}
.charge-label {
  margin-bottom: 5px;
  color: rgba(244, 241, 232, 0.78);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-align: left;
}
.charge-track {
  height: 10px;
  border: 1px solid rgba(210, 235, 222, 0.2);
  border-radius: 999px;
  background: rgba(3, 18, 19, 0.54);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.28);
}
.charge-fill {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--jade-deep), var(--jade) 62%, var(--warm-gold));
  box-shadow: 0 0 12px rgba(132, 210, 188, 0.42);
}
.charge-fill.ready {
  background: linear-gradient(90deg, var(--cinnabar), var(--warm-gold) 52%, #FFF1A8);
}
.game-toast {
  min-height: 36px;
  border-color: rgba(210, 235, 222, 0.34);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.08), transparent 48%),
    rgba(5, 29, 30, 0.9);
  box-shadow: 0 8px 20px rgba(3, 18, 19, 0.3);
  color: var(--moon-white);
}
.game-toast.toast-combo {
  border-color: rgba(132, 210, 188, 0.62);
  background: rgba(7, 46, 44, 0.9);
  color: #E9FFF7;
}
.game-toast.toast-milestone {
  border-color: rgba(238, 207, 122, 0.62);
  background: rgba(56, 39, 18, 0.9);
  color: #FFE39A;
}

/* 游戏设置沿用同一青瓷材质，滑块保持原有数值与事件逻辑 */
#view-settings {
  top: calc(70px + env(safe-area-inset-top, 0px));
}
.settings-panel {
  border: 1px solid var(--celadon-line);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12), transparent 42%),
    rgba(7, 28, 29, 0.94);
  box-shadow: 0 16px 42px rgba(3, 18, 19, 0.42), inset 0 1px 0 rgba(255,255,255,0.08);
}
.settings-title {
  color: var(--moon-white);
}
.setting-row label {
  color: rgba(244, 241, 232, 0.76);
}
.setting-value {
  color: var(--warm-gold);
  font-variant-numeric: tabular-nums;
}
.setting-row input[type="range"] {
  height: 44px;
}
.setting-row input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(132, 210, 188, 0.25);
}
.setting-row input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8.5px;
  background: var(--jade);
  border-color: var(--moon-white);
  box-shadow: 0 0 0 4px rgba(132, 210, 188, 0.12);
}
.setting-row input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(132, 210, 188, 0.25);
}
.setting-row input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--jade);
  border-color: var(--moon-white);
  box-shadow: 0 0 0 4px rgba(132, 210, 188, 0.12);
}
.settings-panel .btn.small {
  min-height: 44px;
  color: var(--moon-white);
  border-color: rgba(132, 210, 188, 0.32);
  background: rgba(132, 210, 188, 0.1);
}

@media (max-width: 380px) {
  #hud {
    top: max(10px, env(safe-area-inset-top, 0px));
    padding: 0 max(10px, env(safe-area-inset-left, 0px));
  }
  .hud-left { min-width: 90px; }
  #hud .score-box { min-width: 80px; padding: 6px 10px 7px; }
  .score-value { font-size: 21px; }
  .hud-right .score-value { font-size: 18px; }
  .score-label { font-size: 9px; }
  .tbtn-pause {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 14px;
  }
  .hud-buttons { gap: 8px; }
  .consumables-panel {
    top: calc(146px + env(safe-area-inset-top, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
  }
  .tbtn-consume { width: 52px; height: 60px; }
  #charge-bar {
    left: 12px;
    right: 96px;
    width: auto;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tbtn,
  .btn,
  .charge-fill,
  .score-value {
    transition: none !important;
  }
  .panel,
  .spinner,
  .tbtn-dye,
  .charge-fill.ready,
  .score-value.bump,
  .invincible-ring,
  .dash-flash.show {
    animation: none !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #hud .score-box,
  #hud .soap-box,
  .hud-buttons,
  .consumables-panel,
  #charge-bar,
  .ctrl-left,
  .tbtn {
    background-color: rgba(7, 28, 29, 0.94);
  }
}
