/* ============================================================================
   boards.css —— 棋盘区（赛季栏 / 排行榜 / 死亡墙 / 留言板 / 大奖横幅）
                  + 彩票 & 刮刮乐面板
   ----------------------------------------------------------------------------
   只用 tokens.css 的变量，不出现任何颜色字面值。
   专题色分工（来自 V1 测绘，别"顺手统一"）：
     · 赛季/结算/荣誉铭牌/奖牌 = 金属色 --metal-hi/mid/lo/deep/edge/ink/wash
       （取值对齐 V1 的饱和正金三档；--season-gold 是暗金，只留给不参与
        金属渐变的旧位置，新代码一律用 metal-*）
     · 彩票      = 紫色 --lottery*
     · 刮刮乐    = 橙色 --scratch*
     · 刮刮乐「排行榜」的档位选中态是**紫色**（原版如此），用 --lottery*。
   ========================================================================== */

/* ── 区块公共骨架 ─────────────────────────────────────────────── */

.board {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4) var(--s5);
  min-width: 0;
}
/* 外层已经是 .card / 侧栏 / 左栏（shell 给的容器）时不再重复内边距 */
.card .board,
.side-card .board,
.col-season .board { padding: 0; }

.board__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  min-width: 0;
}
.board__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.board__sub {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-3);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 顶栏大奖滚动横幅 ────────────────────────────────────────── */

#prize-ticker {
  --pt-row-h: 20px;
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  padding: 6px 14px;
  border: 1px solid var(--metal-edge);
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--metal-wash), var(--warn-soft) 55%, var(--metal-wash));
  color: var(--warn);
  font-size: var(--fs-sm);
  overflow: hidden;
}
.pt__icon { flex: 0 0 auto; font-size: var(--fs-sm); line-height: 1; }
.pt__viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: var(--pt-row-h);
  overflow: hidden;
}
.pt__track { display: flex; flex-direction: column; will-change: transform; }
#prize-ticker[data-scroll="1"] .pt__track {
  animation: pt-scroll var(--pt-dur, 6.4s) linear infinite;
}
#prize-ticker[data-scroll="1"] .pt__track:hover { animation-play-state: paused; }
@keyframes pt-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(calc(var(--pt-count, 1) * var(--pt-row-h) * -1)); }
}
.pt__row {
  height: var(--pt-row-h);
  line-height: var(--pt-row-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.pt__name, .pt__amount { font-weight: 800; color: var(--scratch); }

/* ── 赛季排行榜（B10）：质感对齐 V1 ────────────────────────────
   参照 v1-latest/public/style.css:231-770 与 app.js:513-521 / honorNameHTML()。

   行结构（与 V1 的 li 一一对应）：
     li.lb__row [.is-me]
       ├ span.lb__rank [.lb__rank--top3]   名次：前 3 名奖牌 emoji，4+ 带圈数字
       ├ span.lb__name                     名字；有荣誉时升级为金属铭牌
       │    ├ span.lb__name-text           渐变发光字（无荣誉 = 普通文字）
       │    └ span.lb__honor-beam          铭牌底部流光（仅荣誉框）
       ├ span.lb__group--luck              本赛季彩票/刮刮乐冠军（紫/橙宝石徽章）
       ├ span.lb__group--skull             破产骷髅（血红，每破一次一枚）
       ├ span.lb__group--medal             历史名次奖牌（🏅 系带造型，累积）
       └ span.lb__nums                     净资产（15px/800）+ 今日盈亏（红涨绿跌）

   尺寸/圆角/间距都是 V1 的实测值；颜色只取 tokens.css 的变量，
   「半透明高光/光晕」这类中间色用 color-mix() 在两个变量之间调，不写字面色值
   —— V1 那套 9 段金属渐变在这里落成 5~7 段 token 渐变。 */

.lb { container-type: inline-size; container-name: lb; }

/* 列表：V1 没有内层滚动条（22 个人全量铺开，靠侧栏/页面滚动），
   内层滚动会把第 8 名以后的破产标记埋在下滚动区外，业主反馈过，故去掉。 */
.lb__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 行：V1 `.leaderboard li` = gap 10px + padding 10px 6px + 一条行分割线。
   右侧两行金额（15px + 12px）把行高撑到 ≈58px（V1 ≈56px，V3 改造前 ≈46px）。 */
.lb__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  min-width: 0;
}
.lb__row:last-child { border-bottom: 0; }
/* 自己那行：V1 `li.me` = 极浅蓝底 + 8px 圆角（tokens 里无 8px 档，按 V1 抄） */
.lb__row.is-me {
  background: var(--accent-soft);
  border-radius: 8px;
}

/* 名次：V1 `.rank` 24×24 圆形、12px/700、--surface-3 底；前 3 名换成 18px 奖牌 emoji
   （这里 19px，业主反馈 V1 的名次"大"，V3 原 17px 偏小）。 */
.lb__rank {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lb__rank--top3 {
  background: transparent;
  width: 26px;
  height: 26px;
  font-size: 19px;
}

/* 名字：V1 `.lname` 13px/600；名字是唯一的可压缩元素（shrink=3），
   徽章组以 shrink=1 参与，右侧金额固定不收缩 —— 保证「名字 → 标识 → 金额」的降级顺序。 */
.lb__name {
  display: inline-flex;
  align-items: center;
  flex: 0 3 auto;
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text);
}
.lb__name-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 自己那行名字变主色（V1 是深蓝字 → --accent） */
.lb__row.is-me .lb__name { color: var(--accent); }

/* ── 上赛季冠亚季军：金属荣誉铭牌（V1 patch148/153/170） ──────────
   结构：.lb__name--honor = 金属外框（padding 即框厚）
         ::before         = 深色宝石内底（inset 2px）
         ::after          = 斜向扫光
         .lb__name-text   = 渐变发光字（background-clip:text）+ 细描边 + 外发光
         .lb__honor-beam  = 底部流光 */
.lb__name--honor {
  position: relative;
  padding: 2px;                        /* 框厚（金牌 3px，见下） */
  border-radius: 10px;
  background-image: var(--lb-frame);
  box-shadow: 0 0 0 1px var(--lb-ring), 0 1px 3px var(--overlay);
  isolation: isolate;
  animation: lb-honor-glow 3.2s ease-in-out infinite;
}
.lb__name--honor .lb__name-text {
  position: relative;
  z-index: 4;
  padding: 1px 8px 2px;
  font-weight: 800;
  letter-spacing: .4px;
  /* 兜底：万一渐变里的 color-mix 不被支持，字仍是实心浅金，
     不会因为 background-image 失效 + text-fill 透明而变成"看不见的名字"。 */
  background-color: var(--metal-hi);
  background-image: var(--lb-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-text-stroke: .3px var(--lb-stroke);   /* 半透明细描边（V1 是 rgba 38%），深底可读又不糊字 */
  filter: drop-shadow(0 0 5px var(--lb-text-glow)) drop-shadow(0 1px 1px var(--overlay));
}
.lb__name--honor::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  background-image: var(--lb-gem);
  box-shadow:
    inset 0 1px 1px var(--lb-sheen),
    inset 0 -2px 6px var(--lb-inner);
  z-index: 0;
}
.lb__name--honor::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 3;
  background-image: linear-gradient(105deg,
    transparent 32%, var(--lb-sweep) 46%, var(--surface) 50%, var(--lb-sweep) 54%, transparent 68%);
  background-size: 280% 100%;
  background-position: -160% 0;
  mix-blend-mode: screen;
  animation: lb-honor-sweep 4.5s ease-in-out infinite;
}
.lb__honor-beam {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background-image: var(--lb-beam);
  background-size: 200% 100%;
  background-repeat: repeat-x;
  box-shadow: 0 0 8px var(--lb-beam-glow);
  z-index: 2;
  animation: lb-honor-flow 2.4s linear infinite;
}

/* 冠军：更厚的金框 + 紫水晶底 + 金白渐变字 + 更大的琥珀光环
   （V1 patch170：业主反馈"金牌和铜牌色差不够"，所以金最亮、铜最收敛）
   金属色阶全部走 --metal-*：hi(受光) / mid(正金) / lo(背光) / deep(暗刻) / edge(边光)。
   --surface 在亮色主题里是白、夜间是深底 —— 正好充当金属表面的"镜面高光带"，
   同一段渐变在深浅两套主题下都成立，不需要为夜景再写一份。 */
.lb__name--honor-gold {
  --lb-frame: linear-gradient(180deg,
    var(--surface) 0%, var(--metal-edge) 8%, var(--metal-mid) 20%,
    var(--metal-lo) 34%, var(--metal-edge) 46%, var(--surface) 54%,
    var(--metal-hi) 64%, var(--metal-lo) 78%, var(--metal-deep) 88%,
    var(--metal-wash) 96%, var(--surface) 100%);
  --lb-gem: linear-gradient(180deg, var(--lottery) 0%, var(--text) 58%, var(--text) 100%);
  --lb-text: linear-gradient(180deg,
    var(--surface) 0%, var(--metal-edge) 30%, var(--metal-hi) 62%,
    var(--metal-mid) 100%);
  --lb-beam: linear-gradient(90deg,
    var(--metal-deep) 0%, var(--metal-mid) 18%, var(--metal-edge) 40%,
    var(--surface) 50%, var(--metal-edge) 60%, var(--metal-mid) 82%, var(--metal-deep) 100%);
  --lb-ring: var(--metal-hi);
  --lb-glow: var(--metal-mid);
  --lb-glow-soft: color-mix(in srgb, var(--metal-hi) 55%, transparent);
  --lb-text-glow: var(--metal-hi);
  --lb-stroke: color-mix(in srgb, var(--metal-ink) 46%, transparent);
  --lb-sheen: color-mix(in srgb, var(--surface) 42%, transparent);
  --lb-inner: color-mix(in srgb, var(--text) 55%, transparent);
  --lb-sweep: color-mix(in srgb, var(--surface) 70%, transparent);
  --lb-beam-glow: color-mix(in srgb, var(--metal-mid) 90%, transparent);
  padding: 3px;
  border-radius: 11px;
  animation-duration: 2.6s;
}
.lb__name--honor-gold::before,
.lb__name--honor-gold::after { inset: 3px; border-radius: 8.5px; }
.lb__name--honor-gold .lb__name-text {
  letter-spacing: .5px;
  filter: drop-shadow(0 0 7px var(--metal-edge))
          drop-shadow(0 0 14px var(--metal-mid))
          drop-shadow(0 1px 1px var(--overlay));
}
.lb__name--honor-gold .lb__honor-beam {
  left: 6px; right: 6px; bottom: 3px; height: 2.5px;
}

/* 亚军：白银框 + 深蓝宝石底 + 冰白渐变字 */
.lb__name--honor-silver {
  --lb-frame: linear-gradient(180deg,
    var(--surface) 0%, var(--line) 16%, var(--text-4) 38%,
    var(--surface-2) 54%, var(--text-3) 76%, var(--surface) 100%);
  --lb-gem: linear-gradient(180deg, var(--text-2) 0%, var(--text) 60%, var(--text) 100%);
  --lb-text: linear-gradient(180deg, var(--surface) 0%, var(--bg) 42%, var(--line-strong) 100%);
  --lb-beam: linear-gradient(90deg,
    var(--text-4) 0%, var(--line-strong) 22%, var(--surface) 45%, var(--line-strong) 68%, var(--text-4) 100%);
  --lb-ring: var(--line-strong);
  --lb-glow: var(--line-strong);
  --lb-glow-soft: color-mix(in srgb, var(--line-strong) 45%, transparent);
  --lb-text-glow: var(--line-strong);
  --lb-stroke: color-mix(in srgb, var(--text-3) 42%, transparent);
  --lb-sheen: color-mix(in srgb, var(--surface) 36%, transparent);
  --lb-inner: color-mix(in srgb, var(--text) 50%, transparent);
  --lb-sweep: color-mix(in srgb, var(--surface) 62%, transparent);
  --lb-beam-glow: color-mix(in srgb, var(--line-strong) 85%, transparent);
}
.lb__name--honor-silver .lb__name-text { background-color: var(--line); }

/* 季军：青铜框 + 深褐宝石底 + 哑铜渐变字（V1 patch170：整体压暗、降饱和，别撞金牌） */
.lb__name--honor-bronze {
  --lb-frame: linear-gradient(180deg,
    var(--warn-border) 0%, var(--warn) 16%, var(--scratch) 38%,
    var(--warn-border) 54%, var(--warn) 76%, var(--warn-soft) 100%);
  --lb-gem: linear-gradient(180deg, var(--scratch) 0%, var(--text) 45%, var(--text) 100%);
  --lb-text: linear-gradient(180deg, var(--warn-soft) 0%, var(--warn-border) 45%, var(--warn) 100%);
  --lb-beam: linear-gradient(90deg,
    var(--scratch) 0%, var(--warn) 22%, var(--warn-border) 45%, var(--warn) 68%, var(--scratch) 100%);
  --lb-ring: var(--warn-border);
  --lb-glow: var(--warn);
  --lb-glow-soft: color-mix(in srgb, var(--warn) 40%, transparent);
  --lb-text-glow: var(--warn-border);
  --lb-stroke: color-mix(in srgb, var(--scratch) 42%, transparent);
  --lb-sheen: color-mix(in srgb, var(--surface) 32%, transparent);
  --lb-inner: color-mix(in srgb, var(--text) 55%, transparent);
  --lb-sweep: color-mix(in srgb, var(--surface) 58%, transparent);
  --lb-beam-glow: color-mix(in srgb, var(--warn) 75%, transparent);
}
.lb__name--honor-bronze .lb__name-text { background-color: var(--warn-border); }

/* ── 荣誉美术师（人工指定荣誉，非赛季名次）──────────────────────
   优先级（业主明确要求）：
     有赛季名次（金/银/铜）→ 上面三套金属铭牌，视觉保持不变；
     没有名次、但有 specialHonor === 'artist' → 这一套紫罗兰铭牌。
   设计：紫罗兰 #7c3aed → 靛蓝 #4338ca 渐变底，边框用更亮的紫 #a78bfa，
   外发光 rgba(139,92,246,.45)；文字接近白色 #f5f3ff；
   斜向笔触高光叠一层静态 ::after（金银铜是扫光动画，这里刻意不做持续闪烁）；
   仅在 hover 时轻微上浮 + 加强紫光。 */
.lb__name--honor-artist {
  --lb-frame: linear-gradient(135deg, #a78bfa 0%, #7c3aed 44%, #4338ca 100%);
  --lb-gem: linear-gradient(160deg, #7c3aed 0%, #5b21b6 58%, #4338ca 100%);
  --lb-text: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 55%, #ddd6fe 100%);
  --lb-beam: linear-gradient(90deg, #4338ca 0%, #7c3aed 38%, #a78bfa 50%, #7c3aed 62%, #4338ca 100%);
  --lb-ring: #a78bfa;
  --lb-glow: rgba(139, 92, 246, .65);
  --lb-glow-soft: rgba(139, 92, 246, .45);
  --lb-text-glow: rgba(167, 139, 250, .75);
  --lb-stroke: rgba(67, 56, 202, .55);
  --lb-sheen: rgba(255, 255, 255, .38);
  --lb-inner: rgba(30, 27, 75, .55);
  --lb-sweep: rgba(255, 255, 255, .32);
  --lb-beam-glow: rgba(139, 92, 246, .55);
  animation: none;                 /* 底色不呼吸：静置时保持稳定 */
  box-shadow: 0 0 0 1px #a78bfa, 0 0 9px rgba(139, 92, 246, .45), 0 1px 3px var(--overlay);
  transition: transform .18s ease, box-shadow .18s ease;
}
/* 斜向笔触高光：静态一层，替代金银铜的扫光动画 */
.lb__name--honor-artist::after {
  background-image: linear-gradient(105deg,
    transparent 22%, rgba(255, 255, 255, .35) 46%, transparent 70%);
  background-size: 100% 100%;
  background-position: 0 0;
  animation: none;
  mix-blend-mode: screen;
}
.lb__name--honor-artist .lb__name-text {
  font-weight: 800;
  letter-spacing: .4px;
  background-color: #f5f3ff;
  background-image: var(--lb-text);
  filter: drop-shadow(0 0 5px rgba(167, 139, 250, .5)) drop-shadow(0 1px 1px var(--overlay));
}
.lb__name--honor-artist:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px #a78bfa, 0 0 6px 1px rgba(139, 92, 246, .45),
    0 0 18px 4px rgba(139, 92, 246, .55), 0 3px 10px var(--overlay);
}

/* 荣誉美术师后置图标（16×16 调色盘 + 画笔）：不压缩，窄屏优先省略名字 */
.lb__artist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-left: 3px;
  cursor: help;
  filter: drop-shadow(0 1px 1px var(--overlay));
}
.lb__artist-badge svg { display: block; width: 16px; height: 16px; }

/* 外发光呼吸 / 扫光 / 底部流光（V1 同名三组动画） */
@keyframes lb-honor-glow {
  0%, 100% {
    box-shadow: 0 0 0 1px var(--lb-ring), 0 0 6px 1px var(--lb-glow-soft), 0 2px 6px var(--overlay);
  }
  50% {
    box-shadow: 0 0 0 1px var(--lb-ring), 0 0 18px 4px var(--lb-glow), 0 3px 10px var(--overlay);
  }
}
@keyframes lb-honor-sweep {
  0%, 62% { background-position: -160% 0; }
  85%, 100% { background-position: 260% 0; }
}
@keyframes lb-honor-flow {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* 自己那行的蓝色高亮不能盖掉铭牌（文字已是渐变填充，改色无效，仅保语义） */
.lb__row.is-me .lb__name--honor { color: inherit; }

/* ── 上赛季破产：名字染血红（V1 patch154：只染"上一赛季"破产过的人） ── */
.lb__name--blood { --lb-blood: var(--danger); }
.lb__name--blood:not(.lb__name--honor) .lb__name-text {
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--lb-blood);
  text-shadow: 0 0 5px color-mix(in srgb, var(--up) 55%, transparent), 0 1px 1px var(--overlay);
}
/* 既有铭牌又破产：渐变字换成血红渐变，保留描边与光晕 */
.lb__name--honor.lb__name--blood .lb__name-text {
  background-image: linear-gradient(180deg,
    color-mix(in srgb, var(--up) 55%, var(--surface)) 0%, var(--up) 45%, var(--danger) 100%);
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-color: color-mix(in srgb, var(--danger) 55%, transparent);
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--up) 90%, transparent))
          drop-shadow(0 1px 1px var(--overlay));
}
/* 自己那行的蓝色高亮不能盖掉血红 */
.lb__row.is-me .lb__name--blood .lb__name-text { color: var(--lb-blood); }

/* ── 名字后面的标记组（顺序与 V1 一致：冠军 → 骷髅 → 奖牌） ──────
   V1 `.luck-group` / `.skull-group` / `.medal-group`：单行、不换行、
   名字优先省略、组内元素不压缩。 */
.lb__group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;          /* 最后手段：极端装备下裁切，绝不把金额挤出容器 */
}
.lb__group--skull,
.lb__group--medal { flex: 0 0 auto; }

/* ── 本赛季博彩收益冠军徽章（V1 patch164） ───────────────────────
   与小铭牌同一套造型：厚金属外框（padding 1.5px）+ 深色宝石内底 + 渐变发光字。
   彩票 = 紫，刮刮乐 = 橙（档位越高越深）。颜色全由局部变量给，四种配置共用一套骨架。 */
.lb__luck-slot { display: inline-flex; align-items: center; flex: 0 0 auto; }
.lb__luck {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 1.5px;
  border-radius: 6px;
  background-image: var(--lb-gem-frame);
  box-shadow: 0 0 0 1px var(--lb-gem-ring), 0 1px 2px var(--overlay);
}
.lb__luck::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  border-radius: 4.5px;
  background-image: var(--lb-gem-base);
  box-shadow: inset 0 1px 1px color-mix(in srgb, var(--surface) 28%, transparent),
              inset 0 -1px 3px color-mix(in srgb, var(--text) 45%, transparent);
  z-index: 0;
}
.lb__luck-text {
  position: relative;
  z-index: 2;
  display: block;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  letter-spacing: .2px;
  white-space: nowrap;
  background-image: var(--lb-gem-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 3px var(--lb-gem-glow)) drop-shadow(0 1px 1px var(--overlay));
}
/* 彩票收益冠军：紫色 */
.lb__luck--lottery {
  --lb-gem-frame: linear-gradient(180deg,
    var(--lottery-soft) 0%, var(--lottery-border) 18%, var(--lottery) 40%,
    var(--lottery-border) 56%, var(--lottery) 78%, var(--lottery-soft) 100%);
  --lb-gem-base: linear-gradient(180deg, var(--lottery) 0%, var(--text) 70%, var(--text) 100%);
  --lb-gem-text: linear-gradient(180deg, var(--surface) 0%, var(--lottery-soft) 45%, var(--lottery-border) 100%);
  --lb-gem-ring: var(--lottery-border);
  --lb-gem-glow: var(--lottery-border);
}
/* 刮刮乐三档：5 元最浅 → 100 元最深（V1 SCRATCH_CHAMP_TIERS 的色深阶梯） */
.lb__luck--scratch1 {
  --lb-gem-frame: linear-gradient(180deg,
    var(--scratch-border) 0%, var(--scratch-coat) 18%, var(--scratch) 40%,
    var(--scratch-border) 56%, var(--scratch-coat) 78%, var(--scratch-border) 100%);
  --lb-gem-base: linear-gradient(180deg, var(--scratch) 0%, var(--text) 80%, var(--text) 100%);
  --lb-gem-text: linear-gradient(180deg, var(--surface) 0%, var(--scratch-soft) 45%, var(--scratch-border) 100%);
  --lb-gem-ring: var(--scratch-border);
  --lb-gem-glow: var(--scratch-border);
}
.lb__luck--scratch2 {
  --lb-gem-frame: linear-gradient(180deg,
    var(--scratch-coat) 0%, var(--scratch) 18%, var(--scratch) 40%,
    var(--scratch-coat) 56%, var(--scratch) 78%, var(--scratch-border) 100%);
  --lb-gem-base: linear-gradient(180deg, var(--scratch) 0%, var(--text) 70%, var(--text) 100%);
  --lb-gem-text: linear-gradient(180deg, var(--surface) 0%, var(--scratch-border) 45%, var(--scratch-coat) 100%);
  --lb-gem-ring: var(--scratch-coat);
  --lb-gem-glow: var(--scratch-coat);
}
.lb__luck--scratch3 {
  --lb-gem-frame: linear-gradient(180deg,
    var(--scratch-coat) 0%, var(--scratch) 18%, var(--scratch) 40%,
    var(--scratch-coat) 56%, var(--scratch) 78%, var(--scratch-coat) 100%);
  --lb-gem-base: linear-gradient(180deg, var(--scratch) 0%, var(--text) 55%, var(--text) 100%);
  --lb-gem-text: linear-gradient(180deg, var(--scratch-soft) 0%, var(--scratch-coat) 45%, var(--scratch) 100%);
  --lb-gem-ring: var(--scratch);
  --lb-gem-glow: var(--scratch);
}

/* ── 破产骷髅（V1 patch149/151：破产几次挂几枚，血红呼吸） ────── */
.lb__skull-slot { display: inline-flex; align-items: center; }
.lb__skull {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--danger);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--danger) 45%, transparent));
  animation: lb-skull-pulse 2.6s ease-in-out infinite;
}
.lb__skull svg { display: block; }
@keyframes lb-skull-pulse {
  0%, 100% {
    opacity: .88;
    filter: drop-shadow(0 0 3px color-mix(in srgb, var(--danger) 40%, transparent));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--danger) 75%, transparent));
  }
}

/* ── 冠亚季军奖牌（V1 patch151/152/167） ─────────────────────────
   20×26 的 🏅 造型：上方两条系带、下方圆形牌面（V1 patch167 起牌面不再写赛季号，
   赛季信息走悬停提示「S1 赛季冠军」）。颜色由 --lb-ribbon/--lb-rim/--lb-face 驱动。 */
.lb__medal {
  position: relative;
  width: 24px;
  height: 32px;
  display: inline-block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1.5px color-mix(in srgb, var(--text) 28%, transparent));
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}
.lb__medal:hover {
  transform: translateY(-1.5px) scale(1.06);
  filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--text) 34%, transparent));
}
.lb__medal svg { display: block; }

/* 图片奖牌：美工原图（blank-{tier}.png，赛季号已擦除）+ 叠加的赛季号文字。
   好处是 S5、S6……任意赛季都能显示，不必再找美工出图；文字是真实文本，缩放不糊。 */
.lb__medal-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.lb__medal-season {
  position: absolute;
  left: 11%;
  right: 11%;
  top: 21%;
  height: 28%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.4px;
  pointer-events: none;
}
.lb__medal--gold .lb__medal-season { color: #da6900; }
.lb__medal--silver .lb__medal-season { color: #888; }
.lb__medal--bronze .lb__medal-season { color: #bc3b00; }
.lb__medal-ribbon { fill: var(--lb-ribbon); }
.lb__medal-ribbon-shade { fill: color-mix(in srgb, var(--text) 22%, transparent); }
.lb__medal-rim { fill: var(--lb-rim); }
.lb__medal-face { fill: var(--lb-face); }
.lb__medal-shine { fill: var(--surface); opacity: .42; }
/* 金：金面 + 深红系带 / 银：银面 + 藏蓝系带 / 铜：铜面 + 墨绿系带（V1 原配色，
   金牌 rim/face 取 --metal-deep / --metal-hi —— 与荣誉铭牌同一套金属色） */
.lb__medal--gold { --lb-ribbon: var(--up); --lb-rim: var(--metal-deep); --lb-face: var(--metal-hi); }
.lb__medal--silver { --lb-ribbon: var(--accent); --lb-rim: var(--text-4); --lb-face: var(--line); }
.lb__medal--bronze { --lb-ribbon: var(--down); --lb-rim: var(--warn); --lb-face: var(--scratch-coat); }
/* 奖牌之间叠一点负间距，密集时更像一排徽章（V1） */
.lb__medal + .lb__medal { margin-left: -1px; }

/* ── 右侧数字：净资产（粗黑，比 V1 的 13px 大一号）+ 今日盈亏（红涨绿跌） ──
   V1 `.lright` = margin-left:auto + 右对齐；金额固定不收缩、等宽数字。 */
.lb__nums {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: 0 0 auto;
  text-align: right;
}
.lb__assets {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.2px;
  color: var(--text);
}
.lb__profit {
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.3;
}
.lb__list .empty { padding: var(--s5) var(--s3); }

/* ── 窄容器逐级降级（V1 patch165 的同一套优先级，阈值按 v3 侧栏实测宽调整） ──
   v3 侧栏 360~420px，去掉每边内边距后列表宽 326~388px（1280/1440 视口 = 326，
   ≥1500 = 366，≥1780 = 386）。所以阈值必须整体下移到 300px 以内——
   旧规则 ≤380px 就藏骷髅，而常见桌面宽度正好是 326px，于是破产骷髅永远看不到，
   这正是业主反馈"破产标记找不到"的直接原因。
     优先级：名字/金额 > 荣誉铭牌 > 彩票冠军 > 刮刮乐冠军 > 奖牌 > 骷髅 */
@container lb (max-width: 290px) {
  .lb__group--skull { display: none !important; }
}
@container lb (max-width: 280px) {
  .lb__group--medal { display: none !important; }
}
@container lb (max-width: 260px) {
  .lb__luck-slot[data-tier="5"],
  .lb__luck-slot[data-tier="20"] { display: none !important; }
}
@container lb (max-width: 240px) {
  .lb__group--luck { display: none !important; }
}

/* ── 死亡墙 ──────────────────────────────────────────────────── */

/* 外层卡片（layout.css 的 .death-card）已经给了淡红渐变，这里只排内容 */
.death__note { font-size: var(--fs-2xs); font-weight: 600; color: var(--danger); }
.death__list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  max-height: 260px;
  overflow-y: auto;
}
.death__item {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--danger-border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.death__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}
.death__name { font-size: var(--fs-sm); color: var(--danger); }
.death__time { font-size: var(--fs-2xs); color: var(--text-3); }
.death__reason { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-2); }
.death__facts { margin-top: 1px; font-size: var(--fs-2xs); color: var(--text-3); }

/* ── 留言板 ──────────────────────────────────────────────────── */

.msg__form { display: flex; flex-direction: column; gap: var(--s2); }
.msg__input {
  min-height: 46px;
  max-height: 100px;
  resize: vertical;
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.msg__form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}
.msg__count { font-size: var(--fs-2xs); color: var(--text-4); }
.msg__hint { margin: var(--s2) 0; }
.msg__list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  max-height: 216px;
  overflow-y: auto;
}
.msg__item {
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.msg__item--mine { background: var(--accent-soft); border-color: var(--accent-border); }
.msg__meta { display: flex; align-items: baseline; gap: var(--s2); }
.msg__who { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.msg__when { margin-left: auto; font-size: var(--fs-2xs); color: var(--text-4); }
.msg__del {
  font-size: var(--fs-2xs);
  color: var(--text-4);
  padding: 0 2px;
  border-radius: var(--r-xs);
}
.msg__del:hover { color: var(--danger); background: var(--danger-soft); }
.msg__text {
  margin-top: 2px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg__list .empty { padding: var(--s4) 0; }

/* ── 赛季结算栏 ────────────────────────────────────────────────
   金色只准用 --metal-* 一件套（tokens.css）。V1 的实测值直接标在注释里，
   改尺寸时先看 V1 那边是多少，别凭手感调。
   栏内只剩标题行 + 胶囊 + 历史卡：倒计时在顶栏胶囊，破产名录在右栏死亡墙。 */

/* 胶囊（V1 .season-tab）：未选中是白底细边，选中才是金属渐变 ——
   V3 原来四个胶囊常年淡金底，整个侧栏一片黄，这是"看着堵"的来源之一。 */
.season__tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.season__tab {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-3);
  font-size: var(--fs-2xs);
  font-weight: 700;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.season__tab:hover { border-color: var(--metal-lo); color: var(--metal-text); background: var(--metal-wash); }
.season__tab[data-on="1"] {
  /* V1 这一条是 lo→hi 的金属箔渐变，这里用 --metal-lo → --metal-hi 复刻同一段 */
  background: linear-gradient(90deg, var(--metal-lo), var(--metal-hi));
  border-color: var(--metal-lo);
  color: var(--metal-ink);
  box-shadow: 0 1px 5px color-mix(in srgb, var(--metal-mid) 35%, transparent);
}
.season__hist { display: flex; flex-direction: column; gap: var(--s1); }
.season__hist-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  width: 100%;
  padding: 6px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--fs-2xs);
  font-weight: 700;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.season__hist-toggle:hover {
  border-color: var(--metal-lo);
  color: var(--metal-text);
  background: var(--metal-wash);
}
.season__hist-right { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); }
.season__hist-count { font-size: var(--fs-2xs); }
.season__caret { font-size: var(--fs-2xs); }
.season__hist-panel {
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.season__hist-item {
  display: grid;
  grid-template-columns: 42px 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 7px 8px;
  border-bottom: 1px dashed var(--line);
  font-size: var(--fs-2xs);
  color: var(--text-2);
  text-align: left;
}
.season__hist-item:last-child { border-bottom: none; }
.season__hist-item:hover { background: var(--metal-wash); }
.season__hist-item[data-on="1"] { background: color-mix(in srgb, var(--metal-mid) 16%, var(--surface)); }
.season__hist-champ { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season__card-inner {
  overflow: hidden;
  border: 1px solid var(--metal-edge);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--metal-wash), var(--surface) 38%);
  animation: season-fade var(--dur-base) var(--ease);
}
@keyframes season-fade {
  from { opacity: 0.35; transform: translateY(2px); }
  to { opacity: 1; transform: none; }
}
/* 历史卡标题条（V1 .sc-head）：金属箔渐变（lo→hi），
   深棕字（V1 的暗棕 → --metal-ink），日期右对齐、11px、78% 透明度。
   V3 原来是一整片近乎平涂的淡金 + 深橙日期，两个色块糊在一起才"堵"。 */
.season__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: 8px 10px;
  background: linear-gradient(90deg, var(--metal-lo), var(--metal-hi));
  color: var(--metal-ink);
}
.season__card-no { font-size: var(--fs-md); font-weight: 800; letter-spacing: 0.5px; }
.season__card-date {
  font-size: var(--fs-2xs);
  font-weight: 400;
  color: inherit;
  opacity: 0.78;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 行容器（V1 .sc-rows：padding 6px 8px） */
.season__rows { display: flex; flex-direction: column; padding: 6px 8px; }
.season__row {
  display: grid;
  /* V1 行内是 flex：名次 16 + 名字(flex:1) + 右侧两行（资产在上、涨跌在下）。
     这里用等价 grid，右侧两块合成一块，窄列下名字先省略。 */
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;                 /* V1: 5px 4px */
  border-bottom: 1px dashed var(--line);   /* V1 是虚线，实线会显重 */
  font-size: var(--fs-xs);          /* V1: 12px（V3 原来 11px，行距偏紧） */
}
.season__row:last-child { border-bottom: none; }
/* 前三行淡底色（V1 li.r1/r2/r3）：金/银/铜各一档，用 color-mix 兑在卡片底色上，
   亮色主题是"很淡的一层"，夜间主题自动变成"深色高光"，不需要第二套值。
   圆角只给这三行（V1 也只给 r1/r2/r3；普通行加圆角会把虚线分隔线两端掰弯）。 */
.season__row--1 { background: color-mix(in srgb, var(--metal-mid) 18%, var(--surface)); border-radius: var(--r-sm); }
.season__row--2 { background: color-mix(in srgb, var(--text-4) 16%, var(--surface)); border-radius: var(--r-sm); }
.season__row--3 { background: color-mix(in srgb, var(--scratch-coat) 20%, var(--surface)); border-radius: var(--r-sm); }
.season__rank {
  width: 16px;
  text-align: center;
  color: var(--text-3);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.season__row--1 .season__rank { color: var(--metal-text); }
.season__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 右侧两行（V1 .sc-right）：资产 12px/700 在上，涨跌 10px/400 在下 */
.season__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}
.season__assets {
  font-size: var(--fs-xs);   /* V1 12px */
  font-weight: 700;
  color: var(--text);
}
.season__pct {
  font-size: 10px;           /* V1 10px（tokens 最小档 11px，这里按 V1 原值） */
  font-weight: 400;          /* V1 .sc-right small 不设字重，靠颜色+字号分层 */
}
/* 页脚：V1 .sc-foot = 10.5px / 右对齐 / padding 4px 10px 8px。
   tokens 最小档是 11px，取 --fs-2xs（比 V1 大 0.5px，肉眼无差，不再新增档位）。 */
.season__card-foot {
  padding: 4px 10px 8px;
  font-size: var(--fs-2xs);
  color: var(--text-3);
  text-align: right;
}
.season__empty {
  padding: var(--s5) var(--s3);
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.season__empty small { display: block; margin-top: 4px; font-size: var(--fs-2xs); color: var(--text-4); }
.season__row-empty { padding: var(--s4) var(--s3); font-size: var(--fs-2xs); }

/* ============================================================================
   彩票 / 刮刮乐 面板
   ========================================================================== */

.bet-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  background: var(--overlay);
}
.bet-modal {
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  max-height: calc(100vh - 32px);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.bet-modal--lottery { border-top: 3px solid var(--lottery); }
.bet-modal--scratch { border-top: 3px solid var(--scratch); }

.bet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s4) var(--s5) var(--s3);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.bet-head__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}
.bet-head__sub {
  flex-basis: 100%;
  font-size: var(--fs-xs);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
}
.bet-head__side { flex: 0 0 auto; }
.bet-title { font-size: var(--fs-xl); font-weight: 700; }
.bet-title--lottery { color: var(--lottery); }
.bet-title--scratch { color: var(--scratch); }
.bet-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
}
.bet-pill--lottery { color: var(--lottery); background: var(--lottery-soft); border-color: var(--lottery-border); }
.bet-pill--lottery[data-state="waiting"] { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }
.bet-pill--scratch { color: var(--scratch); background: var(--scratch-soft); border-color: var(--scratch-border); }

.bet-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4) var(--s5) var(--s5);
  overflow-y: auto;
}

.bet-overview {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr 1.6fr;
  gap: var(--s2);
}
.bet-kv {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.bet-kv__label { font-size: var(--fs-2xs); color: var(--text-3); }
.bet-kv__value {
  font-size: var(--fs-sm);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bet-kv__sub {
  font-size: var(--fs-2xs);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bet-kv__value.is-closed { color: var(--warn); }
.bet-periodline { font-size: var(--fs-2xs); color: var(--text-3); line-height: 1.65; }

.bet-section { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.bet-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}
.bet-section__title { font-size: var(--fs-sm); font-weight: 700; }
.bet-section__sub { font-size: var(--fs-2xs); color: var(--text-3); }
.bet-section__hint { font-size: var(--fs-2xs); color: var(--text-3); }
.bet-col { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }

.bet-table { width: 100%; font-size: var(--fs-2xs); }
.bet-table th {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
.bet-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.bet-table tbody tr:last-child td { border-bottom: none; }
.bet-table .num, .bet-table th.num { text-align: right; }
.bet-table-wrap { overflow: auto; }

.bet-records { display: flex; flex-direction: column; gap: var(--s2); max-height: 250px; overflow-y: auto; }
.bet-record {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.bet-record__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}
.bet-record__title { font-size: var(--fs-xs); font-weight: 700; }
.bet-record__meta { font-size: var(--fs-2xs); color: var(--text-3); }
.bet-record__pending { font-size: var(--fs-2xs); color: var(--text-4); }

.balls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ball--sm { width: 20px; height: 20px; font-size: 10px; }
.ball--red { color: var(--lottery-ball); background: var(--up-soft); border: 1px solid var(--up-border); }
.ball--blue { color: var(--lottery-blue); background: var(--accent-soft); border: 1px solid var(--accent-border); }
.ball--empty { color: var(--text-4); background: var(--surface-3); border: 1px dashed var(--line-strong); }
.balls__plus { font-size: var(--fs-2xs); color: var(--text-4); }

.bet-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
}
.bet-pager__label { font-size: var(--fs-2xs); color: var(--text-3); }

.bet-notice {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--warn-border);
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  color: var(--text-2);
  font-size: var(--fs-2xs);
  line-height: 1.65;
}
.bet-notice b { color: var(--warn); }

.bet-confirm { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-sm); }
.bet-confirm__line { display: flex; justify-content: space-between; gap: var(--s3); }
.bet-confirm__label { color: var(--text-3); }
.bet-confirm__value { font-weight: 600; font-variant-numeric: tabular-nums; }
.bet-confirm__note { font-size: var(--fs-2xs); color: var(--text-3); line-height: 1.6; }

.bet-pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}

.bet-rows { display: flex; flex-direction: column; gap: 1px; max-height: 220px; overflow-y: auto; }
.bet-rank {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 4px 6px;
  border-radius: var(--r-sm);
}
.bet-rank:nth-child(odd) { background: var(--surface-2); }
.bet-rank__no {
  flex: 0 0 20px;
  text-align: center;
  font-size: var(--fs-2xs);
  color: var(--text-3);
}
.bet-rank__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bet-rank__name { font-size: var(--fs-xs); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet-rank__meta { font-size: var(--fs-2xs); color: var(--text-3); }
.bet-rank__net { flex: 0 0 auto; font-size: var(--fs-xs); font-weight: 700; }

.btn--lottery { background: var(--lottery); border-color: var(--lottery); color: var(--surface); }
.btn--lottery:hover:not(:disabled) { filter: brightness(0.94); }
.btn--scratch { background: var(--scratch); border-color: var(--scratch); color: var(--surface); font-weight: 700; }
.btn--scratch:hover:not(:disabled) { filter: brightness(0.94); }

/* ── 双色球专用 ──────────────────────────────────────────────── */

.lotto-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--s4);
  align-items: start;
}
.bet-section--pick {
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.lotto-balls { display: grid; gap: 5px; }
.lotto-balls--red { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.lotto-balls--blue {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: var(--s2);
  padding-top: var(--s2);
  border-top: 1px dashed var(--line-strong);
}
.lotto-ball {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 100%;
  max-width: 48px;
  aspect-ratio: 1 / 1;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.lotto-ball--red { color: var(--lottery-ball); background: var(--up-soft); border-color: var(--up-border); }
.lotto-ball--blue { color: var(--lottery-blue); background: var(--accent-soft); border-color: var(--accent-border); }
.lotto-ball:hover:not(:disabled) { transform: translateY(-1px); }
.lotto-ball--red.is-on {
  color: var(--surface);
  background: var(--lottery-ball);
  border-color: var(--lottery-ball);
  box-shadow: 0 0 0 2px var(--up-border);
}
.lotto-ball--blue.is-on {
  color: var(--surface);
  background: var(--lottery-blue);
  border-color: var(--lottery-blue);
  box-shadow: 0 0 0 2px var(--accent-border);
}
.lotto-ball.is-dim { opacity: 0.45; }
.lotto-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.lotto-drafts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 270px;
  overflow-y: auto;
}
.lotto-draft {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.lotto-draft__no { flex: 0 0 auto; font-size: var(--fs-2xs); color: var(--text-3); }
.lotto-draft__del {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0 2px;
  font-size: var(--fs-2xs);
  color: var(--text-4);
}
.lotto-draft__del:hover:not(:disabled) { color: var(--danger); }
.lotto-drafts__empty { padding: var(--s4) 0; }
.lotto-cost { font-size: var(--fs-sm); font-weight: 700; color: var(--lottery); }
.lotto-btns { display: flex; justify-content: flex-end; gap: var(--s2); }
.lotto-drafts__head { margin-top: var(--s2); }

/* ── 刮刮乐专用 ──────────────────────────────────────────────── */

.scratch-tabs {
  display: flex;
  gap: 4px;
  padding: 0 var(--s5) var(--s2);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.scratch-tab {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.scratch-tab:hover { background: var(--surface-3); }
.scratch-tab.is-on { background: var(--scratch); color: var(--surface); font-weight: 700; }
.scratch-pane { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }

.scratch-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
}
.scratch-tier {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s3);
  border: 1px solid var(--scratch-border);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--scratch-soft), var(--surface) 55%);
  box-shadow: var(--shadow-xs);
}
.scratch-tier__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}
.scratch-tier__title { font-size: var(--fs-lg); font-weight: 800; color: var(--scratch); }
.scratch-tier__price { font-size: var(--fs-2xs); color: var(--text-3); }
.scratch-tier__pool {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-2xs);
  color: var(--text-2);
}
.scratch-bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.scratch-bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--scratch-coat), var(--scratch));
  transition: width var(--dur-base) var(--ease);
}
.scratch-tier__facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.scratch-tier__facts > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-2xs);
  color: var(--text-3);
}
.scratch-tier__facts b { font-size: var(--fs-xs); color: var(--text); }
.scratch-tier__windows { font-size: var(--fs-2xs); color: var(--text-4); }
.scratch-tier__btns { display: flex; gap: var(--s2); }
.scratch-buy {
  flex: 1 1 0;
  justify-content: center;
  background: var(--scratch);
  border-color: var(--scratch);
  color: var(--surface);
  font-weight: 700;
}
.scratch-buy:hover:not(:disabled) { filter: brightness(0.94); }
.scratch-buy--max {
  background: var(--surface);
  border-color: var(--scratch-border);
  color: var(--scratch);
}
.scratch-buy--max:hover:not(:disabled) { background: var(--scratch-soft); }

.scratch-cdpill { display: flex; justify-content: flex-end; }
.scratch-cdpill .bet-pill:empty { display: none; }

.scratch-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s3);
  border: 1px solid var(--success-border);
  border-radius: var(--r-sm);
  background: var(--success-soft);
}
.scratch-result__title { font-size: var(--fs-sm); font-weight: 700; color: var(--success); }
.scratch-result__line { font-size: var(--fs-xs); color: var(--text-2); }
.scratch-result__codes { font-size: var(--fs-2xs); color: var(--text-3); word-break: break-all; }
.scratch-result__btns { display: flex; flex-wrap: wrap; gap: var(--s2); }

.scratch-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.scratch-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-2xs);
  color: var(--text-3);
}
.scratch-stat__value { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.scratch-today { font-size: var(--fs-2xs); color: var(--text-3); }
.scratch-cards { display: flex; flex-direction: column; gap: var(--s2); }
.scratch-cards__list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.scratch-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.scratch-card-row__main { min-width: 0; }
.scratch-card-row__title { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-xs); }
.scratch-card-row__meta { font-size: var(--fs-2xs); color: var(--text-3); }
.scratch-tag {
  padding: 0 6px;
  border: 1px solid var(--scratch-border);
  border-radius: var(--r-pill);
  background: var(--scratch-soft);
  color: var(--scratch);
  font-size: var(--fs-2xs);
  font-weight: 700;
}

/* 排行榜档位：刻意沿用 V1 的紫色（不要改成橙色） */
.scratch-tier-tabs { display: flex; flex-wrap: wrap; gap: var(--s2); }
.scratch-tier-btn {
  padding: 5px 14px;
  border: 1px solid var(--lottery-border);
  border-radius: var(--r-pill);
  background: var(--lottery-soft);
  color: var(--lottery);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.scratch-tier-btn:hover { background: var(--lottery-border); }
.scratch-tier-btn.is-on {
  background: var(--lottery);
  border-color: var(--lottery);
  color: var(--surface);
  box-shadow: var(--shadow-xs);
}
.scratch-rank-table th { background: var(--lottery-soft); color: var(--lottery); }

/* ── 刮开浮层 ────────────────────────────────────────────────── */

.scratch-play-mask { z-index: calc(var(--z-modal) + 10); }
.scratch-play-modal { width: min(620px, 100%); border-top: 3px solid var(--scratch); }
.scratch-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 680 / 380;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(140deg, var(--scratch-soft), var(--scratch-border) 55%, var(--scratch-soft));
  box-shadow: inset 0 0 0 6px var(--surface), var(--shadow-md);
}
.scratch-stage.is-pop { animation: scratch-pop 0.5s var(--ease); }
@keyframes scratch-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.scratch-prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}
.scratch-prize__label {
  font-size: var(--fs-2xs);
  letter-spacing: 0.18em;
  color: var(--scratch);
}
.scratch-amount {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}
.scratch-amount.is-win {
  color: var(--danger);
  text-shadow: 0 1px 0 var(--surface), 0 2px 10px var(--danger-border);
}
.scratch-amount.is-miss { color: var(--text-3); }
.scratch-prize__sub {
  padding: 0 var(--s4);
  font-size: var(--fs-xs);
  color: var(--text-2);
  text-align: center;
}
.scratch-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  transition: opacity 0.45s var(--ease);
}
.scratch-canvas.is-cleared { opacity: 0; pointer-events: none; }
.scratch-play-status { display: flex; flex-direction: column; gap: var(--s2); }
.scratch-progress { font-size: var(--fs-sm); font-weight: 600; color: var(--scratch); }
.scratch-play-actions { display: flex; justify-content: flex-end; gap: var(--s2); }
.scratch-tip { border-color: var(--scratch-border); background: var(--scratch-soft); }
.scratch-tip b { color: var(--scratch); }

/* ── 响应式 ──────────────────────────────────────────────────── */

@media (max-width: 1179px) {
  /* V1 行为：窄屏整条隐藏，避免挤掉顶栏状态区 */
  #prize-ticker { display: none; }
}

@media (max-width: 900px) {
  .scratch-tiers { grid-template-columns: 1fr; }
  .lotto-grid { grid-template-columns: 1fr; }
  .bet-overview { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .bet-mask { padding: 0; }
  .bet-modal { max-height: 100vh; border-radius: 0; }
  .bet-head { padding: var(--s3); }
  .bet-body { padding: var(--s3); }
  .scratch-tabs { padding: 0 var(--s3) var(--s2); }
  .bet-overview { grid-template-columns: 1fr; }
  .lotto-balls--red { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .lotto-balls--blue { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .scratch-stats { grid-template-columns: 1fr 1fr; }
  .season__hist-item { grid-template-columns: 40px 48px minmax(0, 1fr); }
  .season__hist-item > span:last-child { display: none; }
}

@media (max-width: 420px) {
  /* 手机单栏：列表宽度 ≈ 视口-32px（≈358px），标记按容器查询自然降级即可，
     这里只把行内边距与净资产收一号，给名字多留 4px。 */
  .lb__row { padding: 9px 4px; gap: 7px; }
  .lb__assets { font-size: var(--fs-md); }
  .msg__form-foot { flex-wrap: wrap; }
  .lotto-balls--red { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  #prize-ticker[data-scroll="1"] .pt__track { animation: none; }
  .season__card-inner { animation: none; }
  .scratch-stage.is-pop { animation: none; }
  .scratch-bar i { transition: none; }
  .scratch-canvas { transition: none; }
}