/* Half Slack — 统一 UI 组件 v3：Boss Gaze Game UI
 * 含：危险指示器、进度条、分数/倍率、姿态指示、Boss 视线、模态、Toast
 */

/* ===== 按钮系统 ===== */
.btn, .btn-primary, .btn-ghost, .icon-btn, .seg-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 var(--sp-4);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled, .btn-primary:disabled, .btn-ghost:disabled,
.icon-btn:disabled, .seg-item:disabled {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--sh-2);
}
.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: var(--sh-3);
}
.btn-primary:active:not(:disabled) { transform: scale(0.97); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost:active:not(:disabled) { transform: scale(0.97); }

.icon-btn {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  padding: 0;
  width: var(--tap);
  min-width: var(--tap);
}
.icon-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.icon-btn:active:not(:disabled) { transform: scale(0.95); }
.icon-btn svg, .icon-btn img { width: 20px; height: 20px; display: block; }

/* ===== 分段控制 ===== */
.seg { display: inline-flex; gap: 0; background: var(--bg-elevated); border-radius: var(--r-pill); padding: 2px; }
.seg-item {
  background: transparent; color: var(--ink-muted);
  border: none; border-radius: var(--r-pill);
  padding: 0 var(--sp-3);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.seg-item:hover:not(:disabled) { color: var(--ink); }
.seg-item.active { background: var(--accent); color: #fff; }

/* ===== 面板/卡片 ===== */
.panel, .card, .score-box, .leaderboard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.panel { padding: var(--sp-4); }
.card { padding: var(--sp-4); }

/* ===== HUD 分数盒 ===== */
.score-box {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  min-width: 80px;
}
.score-box .k { font-size: var(--fs-xs); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.score-box .v { font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.score-box.accent .v { color: var(--accent); }

/* ===== 排行榜组件 ===== */
.leaderboard { padding: 0; overflow: hidden; }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row {
  display: flex; align-items: baseline; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-top: 1px solid var(--line);
}
.lb-row:first-child { border-top: none; }
.lb-rank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 24px; padding: 0 6px;
  font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink-muted); background: transparent; border-radius: var(--r-sm);
}
.lb-row .lb-rank.top1 { color: #ffd700; }
.lb-row .lb-rank.top2 { color: #c0c0c0; }
.lb-row .lb-rank.top3 { color: #cd7f32; }
.lb-row.me .lb-rank { color: var(--accent); }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-base); color: var(--ink); }
.lb-score { font-size: var(--fs-base); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 60px; text-align: right; }
.lb-row.me { background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; }
.lb-row.me .lb-name, .lb-row.me .lb-score { color: var(--accent); }
.lb-empty { padding: var(--sp-5); text-align: center; color: var(--ink-muted); font-style: italic; font-size: var(--fs-sm); }
/* The card is flush (padding:0) so the rows own their own padding — give the
 * header/footer theirs here, since the studio baseline assumes a padded card. */
.leaderboard > .lb-head { margin: 0; padding: var(--sp-3) var(--sp-3) var(--sp-2); font-size: var(--fs-xs); }
.lb-foot { margin: 0; padding: var(--sp-2) var(--sp-3) var(--sp-3); text-align: center; font-size: var(--fs-xs); color: var(--ink-muted); }
.lb-foot:empty { display: none; }

/* ===== 模态/底部弹窗 ===== */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: var(--sp-4); background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.sheet {
  width: 100%; max-width: 420px; max-height: 85vh;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  overflow: hidden; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.sheet header h2 { margin: 0; font-size: var(--fs-xl); font-weight: 700; }
.sheet .close { background: none; border: none; color: var(--ink-muted); font-size: 24px; line-height: 1; cursor: pointer; padding: var(--sp-1); min-height: var(--tap); min-width: var(--tap); }
.sheet .close:hover { color: var(--accent); }
.sheet main { flex: 1; overflow-y: auto; padding: var(--sp-4); }
.sheet footer { display: flex; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }

/* ===== Toast 通知 ===== */
.toasts { position: fixed; bottom: max(var(--sp-6), env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-3); min-width: 200px; max-width: 90vw; animation: toast-in var(--dur-base) var(--ease-out); }
.toast.success { border-color: var(--safe); }
.toast.error { border-color: var(--danger); }
.toast .icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast .msg { flex: 1; font-size: var(--fs-sm); color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 状态组件 ===== */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); padding: var(--sp-6); text-align: center; color: var(--ink-muted); }
.state .spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 统计标签 ===== */
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat .k { font-size: var(--fs-xs); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ===== 语言选择器 ===== */
select[data-lang-select] {
  -webkit-appearance: none; appearance: none;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  min-height: var(--tap); min-width: var(--tap);
  padding: 0 var(--sp-3);
  font-family: inherit; font-size: var(--fs-base); font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9dc3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
  padding-right: 32px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
select[data-lang-select]:hover:not(:disabled) { border-color: var(--accent); }
select[data-lang-select]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select[data-lang-select]:disabled { opacity: .45; cursor: default; }

/* ===== 工作室品牌标记 ===== */
.studio-mark { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-weight: 700; font-size: var(--fs-lg); color: var(--ink); text-decoration: none; }
.studio-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.studio-mark .tagline { font-size: var(--fs-xs); font-weight: 400; color: var(--ink-muted); }

/* ===== 启动闪屏 ===== */
.splash { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: var(--bg); animation: splash-fade 300ms ease; }
.splash.hidden { animation: splash-out 300ms ease forwards; }
@keyframes splash-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-out { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
.splash .content { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); text-align: center; }
.splash .studio-mark { font-size: var(--fs-4xl); color: var(--accent); }
.splash .tagline { font-size: var(--fs-md); color: var(--ink-muted); font-weight: 400; }

/* ===== 更多游戏互推面板 ===== */
.more-games { padding: var(--sp-4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); }
.more-games h3 { margin: 0 0 var(--sp-3); font-size: var(--fs-xl); font-weight: 700; display: flex; align-items: center; gap: var(--sp-2); }
.more-games .studio-mark { font-size: var(--fs-base); }
.more-games .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); }
.more-games .card { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-decoration: none; color: inherit; padding: var(--sp-3); background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--r-md); transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast); }
.more-games .card:hover { transform: translateY(-2px); box-shadow: var(--sh-3); border-color: var(--accent); }
.more-games .cover { width: 100%; aspect-ratio: 16/9; border-radius: var(--r-sm); object-fit: cover; background: var(--bg); }
.more-games .title { font-size: var(--fs-sm); font-weight: 600; text-align: center; }
.more-games .tagline { font-size: var(--fs-xs); color: var(--ink-muted); text-align: center; }

/* ===== 页脚署名 ===== */
.footer { margin-top: var(--sp-6); padding: var(--sp-4); text-align: center; font-size: var(--fs-xs); color: var(--ink-muted); }
.footer a { color: var(--ink-muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ============================================
   Boss Gaze Game HUD 组件（v3 新增）
   ============================================ */

/* ===== 游戏包装器 ===== */
.board-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4/3;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-3);
  border: 1px solid var(--line);
}
.board-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ===== HUD Overlay ===== */
.hud-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-hud);
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

/* ===== 危险指示器（置顶） ===== */
.danger-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: linear-gradient(180deg, rgba(10,14,20,0.95) 0%, rgba(10,14,20,0.7) 100%);
  border-bottom: 1px solid var(--line);
}
.danger-indicator .boss-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: background var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.danger-indicator .boss-icon.safe { background: var(--safe-ring); color: var(--safe); }
.danger-indicator .boss-icon.warning { background: var(--warning-ring); color: var(--warning); animation: boss-pulse 0.8s ease-in-out infinite; }
.danger-indicator .boss-icon.danger { background: var(--danger-ring); color: var(--danger); animation: boss-pulse 0.4s ease-in-out infinite; }
@keyframes boss-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.danger-meter {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.danger-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--r-pill);
  transition: width 100ms linear, background var(--dur-base) var(--ease);
}
.danger-meter-fill.safe { background: var(--safe); }
.danger-meter-fill.warning { background: var(--warning); }
.danger-meter-fill.danger { background: var(--danger); animation: danger-flash 0.5s ease-in-out infinite; }
@keyframes danger-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.danger-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 var(--sp-2);
  min-width: 48px;
  text-align: right;
}
.danger-label.safe { color: var(--safe); }
.danger-label.warning { color: var(--warning); }
.danger-label.danger { color: var(--danger); animation: label-blink 0.5s ease-in-out infinite; }
@keyframes label-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== 进度条 ===== */
.progress-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-4);
  background: rgba(10,14,20,0.6);
}
.progress-track {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--multiplier));
  border-radius: var(--r-pill);
  transition: width 100ms linear;
}
.progress-time {
  font-size: var(--fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
  min-width: 32px;
  text-align: right;
}

/* ===== 中心信息区 ===== */
.hud-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-4);
}
.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.score-value {
  font-size: var(--fs-5xl);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  transition: color var(--dur-base) var(--ease), text-shadow var(--dur-base) var(--ease);
}
.score-value.slack { color: var(--slack); text-shadow: 0 0 20px var(--slack-glow); }
.score-value.work { color: var(--safe); text-shadow: 0 0 20px var(--safe-glow); }
.score-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}
.mult-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--sp-1) var(--sp-3);
  background: var(--multiplier-glow);
  border: 1px solid var(--multiplier);
  border-radius: var(--r-pill);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--multiplier);
  box-shadow: var(--sh-glow-mult);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.mult-badge.pop { transform: scale(1.2); }
.mult-badge .mult-icon { font-size: var(--fs-md); }

/* ===== 姿态指示器 ===== */
.pose-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: rgba(10,14,20,0.8);
  border-top: 1px solid var(--line);
}
.pose-state {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.pose-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  transition: background var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.pose-dot.work { background: var(--safe); box-shadow: 0 0 8px var(--safe-glow); }
.pose-dot.slack { background: var(--slack); box-shadow: 0 0 8px var(--slack-glow); animation: slack-pulse 1s ease-in-out infinite; }
@keyframes slack-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}
.pose-text {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pose-text.work { color: var(--safe); }
.pose-text.slack { color: var(--slack); }
.pose-hint {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-left: auto;
}

/* ===== Boss 视线方向指示器 ===== */
.boss-direction {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--danger);
  transition: opacity var(--dur-base) var(--ease);
}
.boss-direction.hidden { opacity: 0; }
.boss-arrow { font-size: var(--fs-md); animation: arrow-bounce 0.6s ease-in-out infinite; }
@keyframes arrow-bounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
}

/* ===== 结果模态 ===== */
.result-sheet {
  position: absolute;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  background: rgba(10,14,20,0.95);
  backdrop-filter: blur(8px);
  padding: var(--sp-5);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.result-sheet.visible { opacity: 1; pointer-events: auto; }
.result-sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); }
.result-sheet h2 { font-size: var(--fs-2xl); font-weight: 800; }
.result-sheet .final-score { font-size: var(--fs-5xl); font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; text-align: center; margin: var(--sp-3) 0; text-shadow: 0 0 30px var(--accent-glow); }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin: var(--sp-4) 0; }
.result-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--sp-3); background: var(--bg-elevated); border-radius: var(--r-md); border: 1px solid var(--line); }
.result-stat .k { font-size: var(--fs-xs); color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.result-stat .v { font-size: var(--fs-2xl); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.result-stat .v.safe { color: var(--safe); }
.result-stat .v.danger { color: var(--danger); }
.result-stat .v.mult { color: var(--multiplier); }
.result-sheet footer { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.result-sheet .btn-primary { width: 100%; padding: var(--sp-3); font-size: var(--fs-lg); }
.result-sheet .btn-ghost { width: 100%; }

/* ===== P0 班后日报：分数+心情点 / 90 秒战报条 / 倒计时 / 分享 ===== */
.report-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
}
.report-mood-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--r-full);
  background: var(--safe);
  box-shadow: 0 0 12px currentColor;
  flex-shrink: 0;
}
.result-sheet .final-score { margin: 0; }

/* 90 格战报条：绿=摸鱼 / 蓝=干活 / 红=被抓；金点=末秒闪避，金缺口=双 gaze */
.battle-bar {
  display: flex;
  gap: 1px;
  height: 18px;
  margin: var(--sp-3) 0 var(--sp-2);
  padding: 0 2px;
}
.bb-cell { flex: 1; min-width: 0; border-radius: 2px; position: relative; }
.bb-cell.slack { background: var(--safe); }
.bb-cell.work { background: var(--accent); }
.bb-cell.caught { background: var(--danger); }
.bb-cell.late::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -4px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: var(--r-full);
  background: #ffcf5c;
}
.bb-cell.double { box-shadow: 0 -3px 0 -1px #ffcf5c; }

/* 下一路线倒计时（🌐 = UTC 全球同一时刻，零语言） */
.next-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--ink-dim);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin: var(--sp-2) 0;
}
.next-route .nr-time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.share-status {
  min-height: 18px;
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--safe);
  margin-top: var(--sp-2);
}

/* 被抓瞬间：HUD 分数闪红 + 抖动（25% 扣分必须被「看见」） */
.score-value.caught-flash {
  color: var(--danger) !important;
  text-shadow: 0 0 24px var(--danger-glow, rgba(239, 68, 68, 0.6)) !important;
  animation: score-shake 0.4s var(--ease);
}
@keyframes score-shake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ===== 开始屏幕 ===== */
.start-screen {
  position: absolute;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Safe centering: auto margins center the stack when it fits and let it
   * scroll from the top when it doesn't. justify-content:center + overflow
   * would clip the TOP of the content instead, which is worse. The board
   * wrapper is a fixed 4:3 box (~296px of usable height on desktop, ~200px
   * on phones) — this overlay MUST be scrollable, not just centered. */
  justify-content: flex-start;
  overflow-y: auto;
  gap: var(--sp-3);
  background: rgba(10,14,20,0.92);
  backdrop-filter: blur(4px);
  padding: var(--sp-5);
  text-align: center;
}
.start-screen > :first-child { margin-top: auto; }
.start-screen > :last-child { margin-bottom: auto; }
.start-screen h1 { font-size: clamp(26px, 5vw, 42px); font-weight: 900; line-height: 1.1; color: var(--ink); margin: 0; }
.start-screen .tagline { font-size: var(--fs-md); color: var(--ink-muted); max-width: 280px; line-height: 1.5; margin: 0; }
.start-screen .tips { display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-1) 0; }
.start-screen .tip { font-size: var(--fs-sm); color: var(--ink-dim); display: flex; align-items: center; gap: var(--sp-2); }
.start-screen .tip .icon { font-size: var(--fs-lg); }
.start-screen .tip .icon.work { color: var(--safe); }
.start-screen .tip .icon.slack { color: var(--slack); }
.start-screen .tip .icon.late { color: var(--multiplier); }
.start-screen .tip .icon.danger { color: var(--danger); }
.start-screen .btn-primary { margin-top: var(--sp-2); padding: var(--sp-3) var(--sp-6); font-size: var(--fs-xl); flex-shrink: 0; }

/* ===== 模式选择（P1 骨架占位，实现轮接模式系统，见 docs/impl-plan-p1-v1.md）===== */
.start-screen .mode-select {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
}
.start-screen .mode-btn {
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.4;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.start-screen .mode-btn:hover { color: var(--ink); }
.start-screen .mode-btn.is-selected {
  color: var(--safe);
  border-color: var(--safe);
  background: rgba(34, 197, 94, 0.12);
}
.start-screen .mode-hint {
  font-size: var(--fs-sm);
  color: var(--ink-dim);
  margin: 0;
}
@media (max-width: 520px) {
  .start-screen .mode-btn { font-size: 11px; padding: var(--sp-1) var(--sp-2); }
}

/* ===== 响应式 ===== */
@media (max-width: 520px) {
  .board-wrapper { border-radius: var(--r-md); }
  .danger-indicator { padding: var(--sp-1) var(--sp-3); }
  .boss-icon { width: 28px; height: 28px; font-size: 16px; }
  .score-value { font-size: var(--fs-4xl); }
  .result-stats { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
  .result-stat .v { font-size: var(--fs-xl); }
  /* The 4:3 board is only ~270px tall on a phone minus overlay padding — the
   * start screen must compact itself to fit, or the button gets clipped. */
  .start-screen { padding: var(--sp-4); gap: var(--sp-2); }
  .start-screen h1 { font-size: 24px; }
  .start-screen .tagline { font-size: var(--fs-sm); }
  .start-screen .tip { font-size: 11px; }
  .start-screen .tip .icon { font-size: 14px; }
  .start-screen .btn-primary { padding: var(--sp-2) var(--sp-5); font-size: var(--fs-lg); }
  /* P0 班后日报在窄屏压缩：结果屏内容变多，靠已有 overflow-y:auto 滚动，
   * 这里只压字号与间距，保证一屏能看全关键数字。 */
  .result-sheet { padding: var(--sp-4); }
  .result-sheet header { margin-bottom: var(--sp-3); }
  .result-sheet h2 { font-size: var(--fs-xl); }
  .result-sheet .final-score { font-size: var(--fs-4xl); }
  .battle-bar { height: 14px; margin: var(--sp-2) 0; }
  .result-stat { padding: var(--sp-2); }
  .result-stat .k { font-size: 10px; letter-spacing: 0; }
  .next-route { font-size: var(--fs-xs); padding: var(--sp-1) var(--sp-2); }
}
