/* 反应模拟器 —— 暗夜运动风，全 DOM 渲染，零外链资源 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1120;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: #e2e8f0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 30%, #1e293b 0%, #0b1120 65%);
}

/* ---------- 顶栏 ---------- */
#topbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#bestBox {
  font-size: 14px;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 7px 14px;
}

#bestVal { color: #facc15; font-weight: 700; }

.mini-btn {
  font-size: 14px;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  outline: none;
}
.mini-btn:active { background: rgba(148, 163, 184, 0.32); }

/* ---------- 状态文案 ---------- */
#statusText {
  font-size: 20px;
  font-weight: 600;
  color: #cbd5e1;
  min-height: 28px;
  text-align: center;
}

/* ---------- 圆盘 ---------- */
#circle {
  width: min(68vw, 300px);
  height: min(68vw, 300px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.08s linear, transform 0.08s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

#circleLabel {
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.state-idle    { background: #2563eb; }
.state-idle:active { transform: scale(0.96); }
.state-wait    { background: #dc2626; animation: pulse 1.1s ease-in-out infinite; }
.state-go      { background: #16a34a; transform: scale(1.04); box-shadow: 0 0 60px rgba(34, 197, 94, 0.55); }
.state-bad     { background: #d97706; }
.state-done    { background: #0891b2; }
.state-done #circleLabel { font-size: 64px; }
.state-summary { background: linear-gradient(135deg, #7c3aed, #db2777); }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.97); }
}

/* ---------- 副文案 / 轮次 ---------- */
#subText {
  font-size: 14px;
  color: #94a3b8;
  text-align: center;
  min-height: 20px;
}

#roundDots {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
}

.dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 5px;
  border-radius: 50%;
  font-size: 11px;
  color: #64748b;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.dot.done {
  color: #0b1120;
  background: #22d3ee;
  border-color: #22d3ee;
  font-weight: 700;
}

/* ---------- 排行榜弹层 ---------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden { display: none; }

.modal-card {
  width: min(86vw, 380px);
  max-height: 70vh;
  background: #111c33;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.rank-list {
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
}

.rank-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 6px;
  font-size: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.rank-loading { justify-content: center; color: #94a3b8; text-align: center; line-height: 1.7; }

.rank-row .rk { width: 34px; text-align: center; font-weight: 700; color: #facc15; flex-shrink: 0; }
.rank-row .av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: #334155;
}
.rank-row .nk { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .sc { color: #22d3ee; font-weight: 700; flex-shrink: 0; }
.rank-mine { background: rgba(250, 204, 21, 0.1); border-radius: 8px; }

/* ---------- 通用隐藏 ---------- */
.hidden { display: none !important; }

/* ---------- 主菜单 ---------- */
#menu {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(20px + env(safe-area-inset-top)) 22px calc(20px + env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 25%, #1e293b 0%, #0b1120 65%);
}

.menu-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.menu-sub { font-size: 14px; color: #94a3b8; margin: 8px 0 30px; }

.mode-card {
  width: 100%;
  max-width: 400px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 18px 18px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.mode-card:active { transform: scale(0.97); }
.mode-card.gojo {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(51, 24, 68, 0.9));
  border-color: rgba(167, 139, 250, 0.45);
}

.mode-emoji { font-size: 26px; }
.mode-name { font-size: 20px; font-weight: 700; margin: 6px 0 4px; }
.mode-desc { font-size: 13px; color: #94a3b8; line-height: 1.5; }
.mode-best { font-size: 12px; color: #64748b; margin-top: 10px; }
.mode-best span { color: #facc15; font-weight: 700; }

#menuRankBtn { margin-top: 6px; padding: 10px 26px; }
#menuFoot { font-size: 11px; color: #475569; margin-top: 22px; }

/* ---------- 空间斩模式 ---------- */
#gLayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0b1120;
  background-size: cover;
  background-position: center top;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
}

.g-bg-wait { background-image: url("assets/img/gojo-bg.jpg"); }
.g-bg-win  { background-image: url("assets/img/gojo-win.jpg"); }
.g-bg-lose { background-image: url("assets/img/gojo-lose.jpg"); background-position: center 20%; }

#gDim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.55);
  pointer-events: none;
}
#gLayer.flash-green #gDim { background: rgba(34, 197, 94, 0.28); }

#gTop {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

#gScoreBox, #gBestBox {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.55);
  border-radius: 999px;
  padding: 7px 14px;
}
#gScoreBox span { color: #22d3ee; }
#gBestBox { color: #94a3b8; font-weight: 400; }
#gBestBox span { color: #facc15; }

#gStatus {
  position: relative;
  z-index: 2;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  min-height: 28px;
  text-align: center;
}

#gCircle {
  position: relative;
  z-index: 2;
  width: min(56vw, 240px);
  height: min(56vw, 240px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  transition: background-color 0.06s linear, transform 0.06s ease;
}

#gLabel {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  text-align: center;
  padding: 0 12px;
}

.g-state-idle { background: #2563eb; }
.g-state-wait { background: #b91c1c; animation: gpulse 0.9s ease-in-out infinite; }
.g-state-go   { background: #16a34a; transform: scale(1.06); box-shadow: 0 0 70px rgba(34, 197, 94, 0.8); }
.g-state-off  { background: rgba(2, 6, 23, 0.35); box-shadow: none; }

@keyframes gpulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.94); }
}

#gHint {
  position: relative;
  z-index: 2;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.85);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  text-align: center;
}

/* 结算遮罩（成功/失败共用） */
#gEnd {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 18px calc(30px + env(safe-area-inset-bottom));
}

#gEndPanel {
  width: 100%;
  max-width: 400px;
  background: rgba(2, 6, 23, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}

#gEndTitle { font-size: 24px; font-weight: 800; color: #ffffff; }
#gEndTitle.win { color: #4ade80; }
#gEndTitle.lose { color: #f87171; }
#gEndSub { font-size: 14px; color: #cbd5e1; margin: 8px 0 16px; line-height: 1.6; }

.g-btns button {
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 12px 0;
  cursor: pointer;
  outline: none;
}
.g-btns-row { display: flex; align-items: center; margin-top: 10px; }
.g-btns-row button { flex: 1; }
#gRewind {
  width: 100%;
  background: linear-gradient(90deg, #a78bfa, #818cf8);
  color: #0b1120;
}
#gRewind:active { filter: brightness(1.15); }
#gRewind.used-up { background: rgba(148, 163, 184, 0.2); color: #64748b; }
#gRetry { background: #22d3ee; color: #0b1120; margin-right: 12px; }
#gRetry:active { background: #67e8f9; }
#gHome { background: rgba(148, 163, 184, 0.25); color: #e2e8f0; }
#gHome:active { background: rgba(148, 163, 184, 0.4); }

/* ---------- 点赞解锁回溯弹层 ---------- */
.like-tip { font-size: 14px; color: #cbd5e1; line-height: 1.7; margin-bottom: 14px; }
.like-tip b { color: #facc15; }
.like-go { background: #fb7299 !important; color: #fff !important; }
.like-msg { font-size: 12px; color: #f87171; min-height: 16px; margin: 6px 0; }

/* ---------- 排行榜页签 ---------- */
.rank-tabs {
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 12px;
}
.rank-tab {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 8px 0;
  cursor: pointer;
  outline: none;
}
.rank-tab.active { background: #22d3ee; color: #0b1120; }

/* ---------- 背景音乐 ---------- */
#bgmBtn {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.55);
  color: #e2e8f0;
  font-size: 19px;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#bgmBtn:active { transform: scale(0.92); }
#bgmBtn.muted { opacity: 0.5; filter: grayscale(1); }

#bgmPanel {
  position: fixed;
  top: calc(62px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 50;
  width: min(78vw, 300px);
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  padding: 14px 16px 12px;
  backdrop-filter: blur(8px);
}

.bgm-title { font-size: 15px; font-weight: 700; color: #e2e8f0; margin-bottom: 12px; }

.bgm-row { display: flex; align-items: center; gap: 10px; }

#bgmMute {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  font-size: 17px;
  cursor: pointer;
  outline: none;
  flex: none;
}

#bgmVol {
  flex: 1;
  height: 28px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
#bgmVol::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.35);
}
#bgmVol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #22d3ee;
  margin-top: -7px;
}
#bgmVol::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.35);
}
#bgmVol::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #22d3ee;
}

#bgmPct { font-size: 13px; font-weight: 700; color: #22d3ee; width: 42px; text-align: right; flex: none; }

.bgm-note { font-size: 11px; color: #64748b; margin-top: 10px; }

/* 点赞按钮改原生链接后的样式补齐 */
a.mini-btn { text-decoration: none; display: inline-block; box-sizing: border-box; }
.like-go { display: block; width: 100%; text-align: center; margin-bottom: 10px; }

/* ---------- 语言切换 ---------- */
#langBtn {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.55);
  color: #e2e8f0;
  font-size: 19px;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#langBtn:active { transform: scale(0.92); }

#langPanel {
  position: fixed;
  top: calc(62px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  z-index: 50;
  width: min(60vw, 220px);
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}

.lang-title { font-size: 14px; font-weight: 700; color: #e2e8f0; margin-bottom: 10px; }

.lang-opt {
  display: block;
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  border: none;
  border-radius: 12px;
  padding: 11px 0;
  margin-top: 8px;
  cursor: pointer;
  outline: none;
}
.lang-opt.active { background: #22d3ee; color: #0b1120; }

/* ---------- 历史记录 ---------- */
.menu-btns { display: flex; gap: 12px; margin-top: 6px; }
.menu-btns .mini-btn { padding: 10px 20px; }

.hist-stats { font-size: 13px; color: #facc15; font-weight: 700; margin-bottom: 10px; }

.like-tip-sub { font-size: 12px; color: #64748b; }

/* ---------- 实验室通用（测试/训练） ---------- */
#tLayer, #trLayer, #ruLayer, #scLayer, #eyeLayer, #zoneLayer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 25%, #1e293b 0%, #0b1120 65%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
}
.lab-top {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lab-chip {
  font-size: 13px; font-weight: 700; color: #e2e8f0;
  background: rgba(2, 6, 23, 0.55);
  border-radius: 999px; padding: 7px 14px;
}
.lab-chip.ok { color: #4ade80; }
.lab-chip.bad { color: #f87171; }
.lab-status { font-size: 20px; font-weight: 700; color: #fff; min-height: 28px; text-align: center; }
.lab-hint { font-size: 13px; color: #94a3b8; text-align: center; line-height: 1.6; }

#tCircle, #ruCircle {
  width: min(56vw, 240px); height: min(56vw, 240px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  transition: background-color 0.06s linear, transform 0.06s ease;
}
#tLabel, #ruLabel {
  font-size: 26px; font-weight: 800; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  pointer-events: none; text-align: center; padding: 0 12px;
}

/* 报告卡 / 结算卡 */
#rpPanel, #ruEnd {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 5; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, 0.72);
  padding: 20px 18px;
}
.rp-card {
  width: 100%; max-width: 400px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px; padding: 18px; text-align: center;
}
.rp-title { font-size: 20px; font-weight: 800; color: #fff; }
.rp-grade { font-size: 24px; font-weight: 800; margin: 10px 0 4px; }
.rp-record { font-size: 13px; color: #facc15; font-weight: 700; margin-bottom: 4px; }
.rp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 14px 0; }
.rp-cell { background: rgba(148, 163, 184, 0.1); border-radius: 12px; padding: 10px 4px; }
.rp-num { font-size: 19px; font-weight: 800; color: #22d3ee; }
.rp-cap { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.rp-tip { font-size: 12px; color: #64748b; line-height: 1.6; margin-bottom: 14px; }
.rp-btn1 { background: #22d3ee !important; color: #0b1120 !important; }
.ru-stat { font-size: 16px; color: #e2e8f0; margin: 12px 0; line-height: 1.8; }
.ru-scorebar { display: flex; gap: 10px; }

/* 训练馆子菜单 */
.tr-sub { font-size: 14px; color: #94a3b8; margin: 4px 0 18px; }
.tr-eye-note { color: #64748b; }

/* 舒尔特方格 */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: min(88vw, 380px);
}
.sc-cell {
  aspect-ratio: 1;
  border: none; border-radius: 12px;
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  font-size: 20px; font-weight: 800;
  cursor: pointer; outline: none;
  transition: background 0.1s ease, transform 0.08s ease;
}
.sc-cell:active { transform: scale(0.94); }
.sc-cell.hit { background: #16a34a; color: #fff; }
.sc-cell.bad { background: #b91c1c; color: #fff; }
.sc-row { width: min(88vw, 380px); margin-top: 14px; }

/* 眼部放松 */
.eye-stage {
  position: relative;
  width: min(88vw, 420px); height: min(60vw, 320px);
  background: rgba(148, 163, 184, 0.08);
  border-radius: 18px;
  overflow: hidden;
}
#eyeBall {
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #67e8f9, #0284c7);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.7);
  left: 0; top: 0;
}

/* 顶栏避开左右上角的 🌐/🎵 固定按钮 */
.lab-top { padding: 0 52px; box-sizing: border-box; }

/* ---------- 追踪训练（MOT） ---------- */
#motLayer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 25%, #1e293b 0%, #0b1120 65%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
}
.mot-ball {
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #67e8f9, #0284c7);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.6);
  left: 0; top: 0;
  cursor: pointer;
}
.mot-ball.cue {
  background: radial-gradient(circle at 35% 35%, #86efac, #16a34a);
  box-shadow: 0 0 34px rgba(74, 222, 128, 0.9);
}
.mot-ball.pick-right { background: radial-gradient(circle at 35% 35%, #86efac, #16a34a); }
.mot-ball.pick-wrong { background: radial-gradient(circle at 35% 35%, #fca5a5, #b91c1c); }
#motEnd {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 5; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, 0.72);
  padding: 20px 18px;
}

/* ---------- 全局紧凑化（UI 缩小一档） ---------- */
/* 首页只留两张趣味卡后空间宽裕，适度回弹字号卡片避免稀疏；超高兜底仍可滚动 */
#menu {
  position: relative;
  justify-content: flex-start;
  overflow-y: auto;
  padding: calc(12px + env(safe-area-inset-top)) 18px calc(12px + env(safe-area-inset-bottom));
}
#menu > .menu-title { margin-top: auto; }
#menu > #menuFoot { margin-bottom: auto; }

.menu-title { font-size: 24px; }
.menu-sub { font-size: 12px; margin: 4px 0 12px; }
#menu .mode-card { padding: 12px 14px 9px; margin-bottom: 10px; border-radius: 14px; }
#menu .mode-emoji { font-size: 21px; }
#menu .mode-name { font-size: 16px; margin: 4px 0 3px; }
#menu .mode-desc { font-size: 11px; line-height: 1.45; }
#menu .mode-best { font-size: 10px; margin-top: 6px; }
#menuFoot { font-size: 9px; margin-top: 8px; }
.mini-btn { font-size: 13px; padding: 9px 18px; }
.menu-btns { margin-top: 2px; }
.menu-btns .mini-btn { padding: 7px 14px; font-size: 12px; }

/* 切换专区入口：首页右上角小按钮（BGM 悬浮钮也在右上，错开一行防叠） */
.zone-btn {
  position: absolute;
  top: calc(58px + env(safe-area-inset-top));
  right: 14px;
  z-index: 3;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  outline: none;
}
.zone-btn:active { background: rgba(148, 163, 184, 0.3); }

/* 切换专区页 */
#zoneLayer { justify-content: flex-start; }
.zone-scroll {
  width: 100%;
  max-width: 400px;
  flex: 1;
  overflow-y: auto;
  margin-top: 6px;
}
.zone-sec { margin-bottom: 18px; }
.zone-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 2px 8px;
}
.zone-sec-title { font-size: 14px; font-weight: 700; color: #e2e8f0; }
.zone-sec-note { font-size: 11px; color: #64748b; }
.zone-sec .mode-card { margin-bottom: 0; }
/* 专区页/训练馆卡片：介于首页大卡与全局紧凑之间的中档尺寸 */
#zoneLayer .mode-card, #trLayer .mode-card { padding: 12px 14px 10px; margin-bottom: 10px; border-radius: 14px; }
#zoneLayer .mode-emoji, #trLayer .mode-emoji { font-size: 20px; }
#zoneLayer .mode-name, #trLayer .mode-name { font-size: 16px; margin: 4px 0 3px; }
#zoneLayer .mode-desc, #trLayer .mode-desc { font-size: 11px; }
#zoneLayer .mode-best, #trLayer .mode-best { font-size: 10px; margin-top: 6px; }
#zoneLayer .zone-sec .mode-card { margin-bottom: 0; }
.zone-soon { opacity: 0.65; }
.zone-soon-note {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  padding: 14px 0;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 13px;
}

#gStatus, .lab-status { font-size: 17px; min-height: 24px; }
#gCircle, #tCircle, #ruCircle { width: min(46vw, 190px); height: min(46vw, 190px); }
#gLabel, #tLabel, #ruLabel { font-size: 20px; }
#gHint, .lab-hint { font-size: 12px; }
#gScoreBox, #gBestBox { font-size: 12px; padding: 6px 11px; }

#gEndPanel { padding: 14px; border-radius: 15px; max-width: 340px; }
#gEndTitle { font-size: 20px; }
#gEndSub { font-size: 13px; margin: 6px 0 12px; }
.g-btns button, .g-btns-row button { font-size: 14px; padding: 10px 0; }
#likeModal .modal-card, #rankModal .modal-card, #histModal .modal-card { max-width: 330px; padding: 14px; }
.modal-title { font-size: 17px; }
.like-tip { font-size: 13px; }

.rp-card { max-width: 340px; padding: 14px; border-radius: 15px; }
.rp-title { font-size: 17px; }
.rp-grade { font-size: 20px; margin: 8px 0 3px; }
.rp-grid { gap: 7px; margin: 10px 0; }
.rp-cell { padding: 7px 3px; border-radius: 10px; }
.rp-num { font-size: 15px; }
.rp-cap { font-size: 10px; }
.rp-tip { font-size: 11px; margin-bottom: 10px; }
.ru-stat { font-size: 14px; margin: 8px 0; }

.sc-grid { gap: 6px; width: min(80vw, 320px); }
.sc-cell { font-size: 16px; border-radius: 10px; }
.eye-stage { width: min(84vw, 380px); height: min(52vw, 260px); }
.tr-sub { font-size: 12px; margin: 2px 0 12px; }
#bgmPanel { width: min(72vw, 260px); padding: 11px 13px 10px; }
#langPanel { width: min(54vw, 190px); padding: 11px 13px; }
.bgm-title, .lang-title { font-size: 13px; margin-bottom: 9px; }
.lang-opt { font-size: 13px; padding: 9px 0; }

/* ---------- Chrome 61 基线回退（小红书容器要求） ---------- */
/* flex gap / grid gap / min() / aspect-ratio 在 Chrome 61 不可用，先给基线值再能力增强 */
.menu-btns { gap: 0; }
.menu-btns .mini-btn + .mini-btn { margin-left: 12px; }
.bgm-row { gap: 0; }
.bgm-row > * + * { margin-left: 10px; }
.ru-scorebar { gap: 0; }
.ru-scorebar > * + * { margin-left: 10px; }

#gCircle, #tCircle, #ruCircle { width: 46vw; height: 46vw; }
.sc-grid { width: 80vw; grid-gap: 6px; }
.sc-cell { height: 15vw; }
.eye-stage { width: 84vw; height: 52vw; }
#bgmPanel { width: 72vw; }
#langPanel { width: 54vw; }

@supports (width: min(1vw, 1px)) {
  #gCircle, #tCircle, #ruCircle { width: min(46vw, 190px); height: min(46vw, 190px); }
  .sc-grid { width: min(80vw, 320px); }
  .sc-cell { height: 15vw; }
  .eye-stage { width: min(84vw, 380px); height: min(52vw, 260px); }
  #bgmPanel { width: min(72vw, 260px); }
  #langPanel { width: min(54vw, 190px); }
}
@supports (aspect-ratio: 1) {
  .sc-cell { height: auto; aspect-ratio: 1; }
}

/* ================================================================
   手操宿傩·不义围殴（三判定点：虎杖/东堂/乌鸦）
   ================================================================ */
.mode-card.sukuna {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(68, 24, 24, 0.9));
  border-color: rgba(248, 113, 113, 0.45);
}

#sLayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0b1120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
}

#sTop {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#sScoreBox, #sBestBox {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 6px 11px;
}
#sScoreBox span { color: #22d3ee; }
#sBestBox { color: #94a3b8; font-weight: 400; }
#sBestBox span { color: #facc15; }

#sStatus {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  min-height: 22px;
  text-align: center;
}

/* 舞台：等待图 1020×867 → 宽高比 85%，用 padding-top  hack（Chrome 61 无 aspect-ratio） */
#sStage { width: 88vw; max-width: 430px; }
#sAspect {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 85%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
#sImg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#sZones {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.s-zone {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.85);
  /* 黑边描底：白底漫画上也看得清框 */
  box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.65), inset 0 0 0 1px rgba(2, 6, 23, 0.35);
  background: rgba(2, 6, 23, 0.12);
  border-radius: 10px;
  transition: background-color 0.05s linear, border-color 0.05s linear;
}
.s-zone-tag {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.s-zone.lit {
  border: 3px solid #22c55e;
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.75), inset 0 0 36px rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.28);
}
.s-zone.lit .s-zone-tag { background: #16a34a; border-color: #4ade80; }

/* 待机中央"点击开始"圆钮；游戏进行中隐藏 */
#sCenter {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36vw;
  height: 36vw;
  max-width: 140px;
  max-height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
#sCenterLabel { font-size: 17px; font-weight: 800; text-align: center; pointer-events: none; }
#sCenter.s-state-idle { background: rgba(37, 99, 235, 0.92); box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5); }
#sCenter.s-state-off { display: none; }

#sHint {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.85);
  text-align: center;
  min-height: 18px;
}

/* 结算遮罩（复用空间斩视觉） */
#sEnd {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 18px calc(30px + env(safe-area-inset-bottom));
}
#sEndPanel {
  width: 100%;
  max-width: 340px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 15px;
  padding: 14px;
  text-align: center;
}
#sEndTitle { font-size: 20px; font-weight: 800; color: #ffffff; }
#sEndTitle.win { color: #4ade80; }
#sEndTitle.lose { color: #f87171; }
#sEndSub { font-size: 13px; color: #cbd5e1; margin: 6px 0 12px; line-height: 1.6; }

/* 排行榜双 Tab */
.rank-tabs {
  display: flex;
  margin: 4px 0 10px;
}
.rank-tab {
  flex: 1;
  font-size: 13px;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 0;
  cursor: pointer;
  outline: none;
}
.rank-tab:first-child { border-radius: 10px 0 0 10px; }
.rank-tab:last-child { border-radius: 0 10px 10px 0; border-left: none; }
.rank-tab.active { color: #fff; background: rgba(37, 99, 235, 0.45); border-color: rgba(96, 165, 250, 0.6); }

/* Chrome 61 基线：#sCenter 的 vw 宽高在老内核可用，max 限制用 @supports 增强 */
#sCenter { max-width: none; max-height: none; }
@supports (width: min(1vw, 1px)) {
  #sCenter { width: min(36vw, 140px); height: min(36vw, 140px); max-width: none; max-height: none; }
}

/* ================================================================
   手操虎杖·能否打出8连黑闪？（盲定时）
   ================================================================ */
.mode-card.itadori {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(59, 24, 27, 0.9));
  border-color: rgba(251, 146, 60, 0.45);
}

#bfLayer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0b1120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
}
#bfLayer.shake { animation: bfshake 0.35s ease-in-out; }
@keyframes bfshake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 4px); }
  40% { transform: translate(6px, -5px); }
  60% { transform: translate(-4px, -3px); }
  80% { transform: translate(3px, 4px); }
}

#bfTop {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#bfScoreBox, #bfBestBox {
  font-size: 12px; font-weight: 700; color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px; padding: 6px 11px;
}
#bfScoreBox span { color: #fb923c; }
#bfBestBox { color: #94a3b8; font-weight: 400; }
#bfBestBox span { color: #facc15; }

#bfStatus {
  font-size: 16px; font-weight: 700; color: #fff;
  min-height: 22px; text-align: center;
}
#bfStatus b { color: #fb923c; font-size: 20px; }

#bfStage {
  position: relative;
  width: 100%;
  max-width: 480px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 计时器：大而醒目，等宽数字防跳动 */
#bfTimerBox { text-align: center; position: relative; z-index: 2; }
#bfTarget { font-size: 15px; color: #fb923c; font-weight: 700; margin-bottom: 8px; min-height: 20px; }
#bfTimer {
  font-size: 56px; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}
#bfTimer.blind { color: #475569; animation: bfblind 1.2s ease-in-out infinite; }
@keyframes bfblind {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 待机中央圆钮 */
#bfCenter {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 36vw; height: 36vw;
  max-width: 140px; max-height: 140px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; z-index: 3;
}
#bfCenterLabel { font-size: 17px; font-weight: 800; text-align: center; pointer-events: none; }
.bf-center.bf-state-idle { background: rgba(194, 65, 12, 0.92); box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5); }
#bfCenter.bf-state-off { display: none; }

/* 三个游戏层的顶栏：两侧留白躲开 🌐/🎵 悬浮钮（同 .lab-top 的处理） */
#gTop, #sTop, #bfTop { padding: 0 52px; box-sizing: border-box; }

/* 命中特效：黑红闪满屏 + 连击图弹入 */
#bfFlashFx {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; opacity: 0; z-index: 4;
}
#bfFlashFx.hit {
  background:
    radial-gradient(ellipse at 50% 55%, rgba(220, 38, 38, 0.85) 0%, rgba(2, 6, 23, 0.95) 55%),
    #020617;
  animation: bfflash 0.55s ease-out;
}
@keyframes bfflash {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}
#bfImg {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  max-width: 92%; max-height: 78%;
  border-radius: 10px;
  z-index: 3;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
}
#bfImg.pop { animation: bfpop 0.5s ease-out; }
@keyframes bfpop {
  0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#bfHint {
  font-size: 12px; color: rgba(226, 232, 240, 0.85);
  text-align: center; min-height: 18px;
}

/* 结算遮罩（复用黑闪视觉） */
#bfEnd {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 5;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 20px 18px calc(30px + env(safe-area-inset-bottom));
}
#bfEndPanel {
  width: 100%; max-width: 340px;
  background: rgba(2, 6, 23, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 15px; padding: 14px; text-align: center;
}
#bfEndTitle { font-size: 20px; font-weight: 800; color: #fff; }
#bfEndTitle.win { color: #fb923c; }
#bfEndTitle.lose { color: #f87171; }
#bfEndSub { font-size: 13px; color: #cbd5e1; margin: 6px 0 10px; line-height: 1.7; }
#bfEndSub b { color: #fb923c; }
#bfErrList { max-height: 120px; overflow-y: auto; margin-bottom: 8px; }
.bf-err-row {
  display: flex; justify-content: space-between;
  font-size: 11px; color: #94a3b8;
  padding: 3px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

/* 演示模式提示（连点音量钮10次触发） */
#demoToast {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  font-size: 13px; font-weight: 700; color: #fff;
  background: rgba(194, 65, 12, 0.92);
  border: 1px solid rgba(251, 146, 60, 0.6);
  border-radius: 999px;
  padding: 8px 18px;
  pointer-events: none;
}

