/* ===== css/tokens.css ===== */
/* 视觉 token 单一入口 · Sand Gold · Summer Casino (2026-08 砂金色板, 见 496a726/ca2c3da)
   所有颜色 / 阴影 / 字体 / 间距 / 圆角都从这里取。
   宪法：Beachfront Casino · 砂金暖色板(黑/白/亮金 #F2B33D/浅金/水光蓝 #A8DCF5) · Typography as Design
        (金色回归砂金透明感, 不要深棕金/冷金 —— 见下方色板段注释)
   倒计时锁定: 仅 黑(normal/warning) + 红(danger) 两色, warning 用墨色+呼吸, 不引入第三色 */

/* Harshita 手写体 · 仅英文落款用 (收据台词 cite), License: 100% free commercial @nestype */
@font-face {
  font-family: 'Harshita';
  src: url('../assets/fonts/Harshita.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Great Vibes 连笔花体 · 已整体移除 (RECEIPT 签名实际走 --font-display) */
/* Space Mono · 数字/功能标签唯一等宽 (2026-09 GAIA 收敛)。
   复古印刷票据气质, 配暖金砂金 + 衬线台词。覆盖 ¥ , : · × + % - / 数字全拉丁。
   单字重 700 (数字/徽章全用粗体); font-weight 声明 400 900 范围, 让 600/800/900 请求命中原生字形免 faux-bold。 */
@font-face {
  font-family: 'Space Mono';
  src: url('../assets/fonts/spacemono-700.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
/* ─── Combo 大字 / 结算 quote 专用三件套 (2026-09 字体迭代定稿, 见 tools/font-final-direction-mockup.html) ───
   Archivo Black: combo 大字文字 (替换 Arial Black, 已子集 A-Z 0-9 × !, 无小写);
   Marcellus: combo ×N 数字 (圆润碑刻);
   Forum: round-end 结算弹窗 quote 台词 (罗马碑刻+圆润字腔)。
   三者只内嵌拉丁+数字 → ZH/JA 同栈自动回落黑体, 中文界面零变化, 无需 :root[lang] 单独覆盖。 */
@font-face {
  font-family: 'Archivo Black';
  src: url('../assets/fonts/archivoblack-400.woff2') format('woff2');
  /* 单字重 400 覆盖 400~900 全范围: 让 display 元素声明的 700/800/900 直接命中原生字形,
     避免 faux-bold 糊字 (Archivo Black 本身即超黑, 无需合成加粗)。 */
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Marcellus';
  src: url('../assets/fonts/marcellus-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Forum';
  src: url('../assets/fonts/forum-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* ─── CJK quote 衬线 (2026-09 字体迭代续: ZH/JA quote 匹配 Forum 古典温润) ───
   EN quote = Forum (罗马碑刻+圆润字腔)。ZH/JA 原回落 Noto Sans SC/JP Black (无衬线方正),
   与 Forum 气质割裂。补 CJK 衬线/明朝体, 中文/日文走温润古典:
   ZH = Noto Serif SC (思源宋体, 标准宋体横细竖粗, 可读性好, OFL, 子集 ~417KB)
   JA = Shippori Mincho (しっぽり明朝, 手写明朝笔锋圆润, OFL, 子集 ~177KB)
   已按 i18n 全量文案子集化 (含教学/副标题/标签字符), 生产可用。
   放置策略: :root[lang] 作用域前置到 --font-quote, 拉丁/数字仍走 Forum (同栈回落)。
   combo 大字三语都是英文+数字, 不需 CJK 补字体。 */
@font-face {
  font-family: 'Noto Serif SC';
  src: url('../assets/fonts/notoserifsc-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Shippori Mincho';
  src: url('../assets/fonts/shippori-mincho-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ─── 主色板 · 奶油底 + 透亮暖金 + 一抹水蓝 ─────────────────────
     金色回归砂金色板: 透明感亮金 #F0C878 + 暖金 #E6A94C, 不要深棕金/冷金
     青蓝只作水光/对抗点缀(更浅更透), 与暖金和谐不抢调              */
  --paper:          #FFFDF8;   /* 主底色 · 奶油白(大幅提亮, 白为主, 仅一丝暖) */
  --paper-elevated: #FFFFFF;   /* 卡片 / 弹窗 · 净白 */
  --ink:            #14100A;   /* 主字色 · 暖墨(回归, 贴砂金/收据黑) */
  --ink-soft:       #57503F;   /* 副字色 · 暖灰(加深一档, 描述文字不再浅) */
  --ink-on-dark:    #FFFFFF;   /* 深底反白 · 纯白(原奶油白 #FBEFCB 偏黄, 统一改白) */
  /* 背景 · 奶油白+浅金(去棕黄) → 中段净白 → 底部浅金 · 高明度低饱和清透 */
  --bg-aqua-glow:   linear-gradient(180deg,
                      #FFFCF6 0%,
                      #FFFFFF 30%,
                      #FFFFFF 68%,
                      #FBF7EC 100%);

  /* 金族 · 砂金色板 · 透明感亮金 + 暖金(去冷调, 不深棕) */
  /* 金族 · 砂金实时财富亮金: 高明度高饱和清爽亮眼, 绝不棕不暗 */
  --sand-gold:      #F2B33D;   /* 主强调 · 亮金(实时财富同族, 提亮去棕) */
  --sand-gold-hi:   #F8CD6E;   /* 透明感亮金 · hover/高光/渐变起点 */
  --c-gold-dark:    #E39A2E;   /* 深金锚点 · 仍是亮金非棕 */
  --c-gold-bright:  #F2B33D;   /* 亮金 · 去棕焕新(跑马灯/进度数字/价格/CTA) */

  /* 青蓝族 · 仅水光/对抗点缀(透亮浅蓝, 不闷不冷) */
  --c-cyan:         #A8DCF5;   /* 水蓝 · 对抗条/水光(透亮) */
  --c-navy:         #4A9BD8;   /* 晴蓝 · RECEIPT 签名/对抗锚点(去闷) */

  /* 图区光晕 · 纯青蓝(白卡用): 微量收敛, 无金不脏(对齐 mockup R12) · 范围稍缩 */
  --glow-slot:      radial-gradient(44% 60% at 50% 52%,
                      rgba(126,199,242,.48) 0%,
                      rgba(160,208,246,.16) 50%,
                      rgba(255,255,255,0) 78%);
  /* 图区光晕 · 金卡用: 去金晕, 仅一丝蓝心, 商品直接浮于金卡面(对齐 mockup R12) */
  --glow-slot-gold: radial-gradient(56% 78% at 50% 52%,
                      rgba(160,205,244,.20) 0%,
                      rgba(160,205,244,.06) 46%,
                      rgba(255,255,255,0) 70%);
  /* 进度条汇聚成金: 金额(亮白金→暖亮金) / 彩蛋(亮蓝→暖亮金), 中点同收 #F2B33D */
  --grad-amt:       linear-gradient(90deg, #FDF3DC, #F8CD6E 45%, #F2B33D);
  --grad-egg:       linear-gradient(270deg, #A8DCF5, #F2CD7E 52%, #F2B33D);
  --c-gold-warm:    #F2B33D;   /* 汇聚中点暖亮金 · 达成态同色 */

  --house-red:      #E63946;   /* 危险 / 失败 · 倒计时 danger 专用, 锁定不动 */
  --ink-hi:         #2A3846;   /* 深墨按钮 hover 提亮(冷化) */

  /* ─── 辅助色 · 倒计时锁定黑红两色, 不再设桃红中间档 ─── */
  --backdrop:       rgba(20, 16, 10, 0.5);    /* 全弹窗遮罩统一(暖墨) */

  /* ─── 通关彩带 · 暖金 + 透亮水蓝 + 白(砍水果色; 暖金主导, 水蓝点缀) ─── */
  --confetti-1:     #F0C878;   /* 亮金 */
  --confetti-2:     #A8DCF5;   /* 透亮水蓝 */
  --confetti-3:     #E6A94C;   /* 暖金 */
  --confetti-4:     #C8E6F8;   /* 冰蓝(更透) */
  --confetti-5:     #FFFFFF;   /* 白 */
  --confetti-6:     #6FB4E0;   /* 晴蓝(压阵, 仅少量, 不冷不闷) */

  /* ─── mono 标签字距 · C5 收敛为 2 档 ─── */
  --tracking-label:  0.16em;   /* 常规 uppercase 小标签 */
  --tracking-kicker: 0.28em;   /* kicker · 更疏 */

  /* ─── 兼容层 · 保留旧变量名映射到新色 · 避免一次性大改所有组件 ─── */
  --c-bg-elevated:  var(--paper-elevated);
  --c-bg-dark:      var(--ink);               /* 统一纯黑 · Hero 视频加载前底色 */
  --c-ink:          var(--ink);
  --c-ink-deep:     var(--ink);
  --c-ink-soft:     var(--ink-soft);
  --c-ink-on-dark:  var(--ink-on-dark);
  --c-gold:         var(--sand-gold);
  --c-gold-light:   var(--sand-gold);       /* 三档合并成单色 */
  /* --c-gold-dark 已在主色板定义 · 此处不再重复 */
  --c-danger:       var(--house-red);
  /* --c-summer-peach 已删(桃红冷化); 各引用点改为冷金/青蓝, 倒计时 warning 改墨色 */

  /* ─── 阴影系统 · 暖金棕底, 配奶油纸浮出金光感 ─── */
  --shadow-soft:    0 24px 60px rgba(31,  26, 15, 0.12),
                    0  4px 12px rgba(31,  26, 15, 0.06);
  --shadow-gold:    0 12px 28px rgba(228, 192, 106, 0.32);   /* 唯一"金光"阴影 */
  /* 发丝描边 + 轻投影 · 卡片 / HUD / 收据复用 */
  --shadow-hairline: inset 0 0 0 1px rgba(31, 26, 15, 0.06),
                     0 6px 18px rgba(31, 26, 15, 0.06);

  /* ─── 渐变 · 透亮暖金 + 一抹水蓝 ─── */
  /* ① Hero 大标题强调字 + 财富 HUD 数字 · 深金→亮金(暖金调) */
  --grad-text-gold: linear-gradient(180deg, #E39A2E 0%, #F2B33D 45%, #F8CD6E 100%);
  /* ② CTA 按钮 · 亮金单色加轻微上下高光模拟金属 */
  --grad-cta:       linear-gradient(180deg, #F8CD6E 0%, #F2B33D 55%, #E39A2E 100%);
  /* ③ MAX OUT 进度条 · 左→右五色连续渐变(与普通模式 linear-gradient 同款):
     蓝(#4A9BD8)→浅蓝(#A8DCF5)→浅金(#F8CD6E)→金(#F2B33D)→深金(#E39A2E), 全取自现有色板 */
  --grad-pk-spectrum: linear-gradient(90deg, #4A9BD8 0%, #A8DCF5 28%, #F8CD6E 55%, #F2B33D 78%, #E39A2E 100%);
  /* ④ 亮金→水蓝渐变 · combo-heat / receipt 会师条(亮金主导, 尾段一抹透亮水蓝) */
  --grad-gold-aqua: linear-gradient(90deg, #F8CD6E 0%, #F2B33D 55%, #A8DCF5 100%);

  /* ─── 字体系统 · 本地/系统字体优先，关键界面不依赖第三方 CDN ─── */
  /* F1 修复：display 字体栈 · 英文 Arial Black(超粗) 在前, 中文系统中黑在后,
     中文场景自动 fallback 到 PingFang/YaHei/HarmonyOS, 再由各组件 font-weight 控制粗细。
     中文标题/按钮统一显式 font-weight:700+, 避免 Arial Black 的 900 遗传到中文变细体。 */
  --font-display: 'Archivo Black', 'Arial Black', 'PingFang SC', 'Microsoft YaHei', 'HarmonyOS Sans SC', system-ui, sans-serif;
  --font-body:    Arial, 'PingFang SC', 'Microsoft YaHei', 'HarmonyOS Sans SC', system-ui, sans-serif;
  /* GAIA 收敛 (2026-09): 等宽统一 Space Mono 一族 —— --font-mono 与 --font-numeric 同源。
     价格/收据/HUD金额/跑马灯/金卡HIT计数/收据小字段/eyebrow/票号/骑缝章 全部自动跟随, 三语言一致。
     Space Mono 等宽滚动不抖 + 复古票据感; 系统栈兜底。 */
  --font-mono:    'Space Mono', 'Cascadia Mono', 'Liberation Mono', ui-monospace, 'Courier New', monospace;
  --font-numeric: 'Space Mono', var(--font-mono);

  /* F2 手写字体: --font-hand Harshita 手账体 · 用于 unlock flourish 等活泼场景
     (Great Vibes 花体 @font-face 已停用, 票据签名改走 --font-display, 见 tokens.css 头部) */
  --font-hand:    'Harshita', cursive;

  /* F3 Combo/quote 专用栈 (2026-09 字体迭代定稿): Archivo Black 大字 / Marcellus ×N 数字 / Forum 台词。
     栈尾回落 --font-display → ZH/JA 界面中文自动落黑体, EN 拉丁/数字用嵌入子集。
     注意: Archivo Black/Marcellus/Forum 均为单字重 400, 引用处须显式 font-weight:400,
     避免继承 900 触发 faux-bold (配合下方 font-synthesis: none)。 */
  --font-combo:     'Archivo Black', var(--font-display);
  --font-combo-num: 'Marcellus', var(--font-display);
  --font-quote:     'Forum', var(--font-display);

  /* ─── 字号 · 保留 8pt 步进 ─── */
  /* 微阶 · 收敛收据/HUD 里 9~12px 的 ad-hoc 值为两档 */
  --fs-3xs: 10px;
  --fs-2xs: 12px;
  --fs-xs:  13px;
  --fs-sm:  14px;
  --fs-md:  16px;
  --fs-lg:  20px;
  --fs-xl:  28px;

  /* ─── 间距 8pt ─── */
  --s-1:  4px;
  --s-2:  8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* ─── 圆角 ─── */
  --r-sm:   8px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-2xl: 40px;
  --r-full: 9999px;

  /* ─── Easing · 只留 2 条 ─── */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);    /* 默认所有 UI 过渡 */
  --ease-doodle: cubic-bezier(0.34, 1.2, 0.64, 1);  /* 极轻弹性 · 仅 doodle 出现 */

  /* 兼容层 · 旧变量指向新曲线 · 避免大规模替换 */
  --easing-out:        var(--ease-out);
  --easing-spring-out: var(--ease-out);
  --easing-bounce:     var(--ease-doodle);

  /* ─── 时长 4 档 ─── */
  --dur-fast:    200ms;   /* hover · 颜色渐变 */
  --dur-base:    320ms;   /* 弹窗 · 卡片出现 */
  --dur-slow:    480ms;   /* punch · pop */
  --dur-hero:    780ms;   /* Hero 入场 */

  /* ─── z-index ───
     分层约定 (低 → 高):
       卡内局部 1-10 裸值 | --z-celebrate 998 (通关会师庆祝)
       --z-spotlight 1000 (教学聚光/fx 覆盖层, 不得再往上排) | --z-combo 1002 (连击大字)
       --z-fx-top 1200 (结算前特殊演出层) | --z-dialog-fx 9998 (aha 闪光/ai-credit)
       --z-fanfare 9999 (MAX OUT 高潮演出/cookie-settings) | --z-banner 10000 (cookie 横幅/教学彩带) */
  --z-raised:     2;
  --z-toast:     99;
  --z-celebrate: 998;
  --z-spotlight: 1000;
  --z-combo:     1002;
  --z-fx-top:    1200;
  --z-dialog-fx: 9998;
  --z-fanfare:   9999;
  --z-banner:    10000;

  /* ─── 三端适配边界（文档镜像；运行时权威源见 js/layout-profile.js） ───
     mobile <= 760；tablet 761-1024，或 1025-1366 的触屏设备；其余为 desktop。
     CSS 组件禁止直接使用这些变量猜设备，只读取 html[data-layout]。 */
  --bp-mobile-max:      760px;
  --bp-tablet-max:     1024px;
  --bp-tablet-wide-max: 1366px;
}

/* ─── P1+P2 · ZH/JA 字重追平 + CJK 嵌入字体 ─────────────────────
   EN 走 Arial Black(900 极粗), ZH/JA 的 Arial Black 无 CJK 字形 → 原本落系统黑体,
   字重断档(400-700) + 跨设备漂移。此处:
   1) @font-face 嵌入 Noto Sans JP/SC (OFL 开源, 已按 i18n 文案子集化, 每字重 ~177-216KB),
      Regular 400 / Bold 700 / Black 900 三档, display 用 900、body 用 400/700;
      font-display:swap 避免 FOIT。
   2) :root[lang] 作用域把 --font-display/--font-body 换成嵌入字体优先的栈,
      同时 display 场景统一 font-weight:900 追平 EN 视觉重量。EN 不在作用域内, 不受影响。 */
@font-face {
  font-family: 'Noto Sans JP';
  src: url('../assets/fonts/NotoSansJP-Regular-subset.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Noto Sans JP';
  src: url('../assets/fonts/NotoSansJP-Bold-subset.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Noto Sans JP';
  src: url('../assets/fonts/NotoSansJP-Black-subset.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('../assets/fonts/NotoSansSC-Regular-subset.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('../assets/fonts/NotoSansSC-Bold-subset.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('../assets/fonts/NotoSansSC-Black-subset.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}

:root[lang="ja"] {
  --font-display: 'Noto Sans JP', 'Archivo Black', 'Arial Black', 'PingFang SC', 'Microsoft YaHei', 'HarmonyOS Sans SC', system-ui, sans-serif;
  --font-body:    'Noto Sans JP', Arial, 'PingFang SC', 'Microsoft YaHei', 'HarmonyOS Sans SC', system-ui, sans-serif;
  /* JA quote 前置 Shippori Mincho (手写明朝温润), 拉丁/数字仍回落 Forum (同栈) */
  --font-quote:   'Forum', 'Shippori Mincho', var(--font-display);
}
:root[lang="zh-CN"] {
  --font-display: 'Noto Sans SC', 'Archivo Black', 'Arial Black', 'PingFang SC', 'Microsoft YaHei', 'HarmonyOS Sans SC', system-ui, sans-serif;
  --font-body:    'Noto Sans SC', Arial, 'PingFang SC', 'Microsoft YaHei', 'HarmonyOS Sans SC', system-ui, sans-serif;
  /* ZH quote 前置 Noto Serif SC (思源宋体, 可读性优于仿宋), 拉丁/数字仍回落 Forum (同栈) */
  --font-quote:   'Forum', 'Noto Serif SC', var(--font-display);
}
:root[lang="ja"] :where([class*="item-card"], [class*="hud"], [class*="hero"], [class*="intro"], [class*="receipt"], [class*="challenge"], [class*="unlock"], [class*="ticker"], [class*="share"], [class*="endless"], [class*="combo"], [class*="maxout"], [class*="finale"], [class*="title"], [class*="btn"], [class*="pill"], [class*="badge"], [class*="seal"]),
:root[lang="zh-CN"] :where([class*="item-card"], [class*="hud"], [class*="hero"], [class*="intro"], [class*="receipt"], [class*="challenge"], [class*="unlock"], [class*="ticker"], [class*="share"], [class*="endless"], [class*="combo"], [class*="maxout"], [class*="finale"], [class*="title"], [class*="btn"], [class*="pill"], [class*="badge"], [class*="seal"]) {
  font-weight: 900;
}
/* 例外: combo 大字在 ZH/JA 下也不追平 900 ——
   Archivo Black/Marcellus 是单字重 400 子集, 900 会 faux-bold 糊掉字形;
   中文回落字体自身有 Black 档, 数字/拉丁按 400 原重即定稿视觉 (EN 同栈同效果, 语言无关)。 */
:root[lang="ja"] .combo-fx,
:root[lang="zh-CN"] .combo-fx {
  font-weight: 400;
  font-synthesis: none;
}
/* 字体体系收敛例外 (2026-09): quote 衬线元素 (副标题/标签) 保持 400,
   卡标题 700, HUD 金额数字 700 —— 不被上方 900 追平覆盖:
   Noto Serif SC/Shippori Mincho/Forum 均为单字重 400;
   Space Mono 数字已用 font-weight:400 900 范围声明, 任意字重命中原生字形, 无需在此额外豁免。
   2026-09-06: .spotlight-text 已切黑体 --font-display (教学气泡弃衬线), 从 400 豁免清单移除,
   让 tutorial.css 的 font-weight:700 生效。 */
:root[lang="ja"] :is(.item-meta, .wealth-hud__label, .unlock-quote),
:root[lang="zh-CN"] :is(.item-meta, .wealth-hud__label, .unlock-quote) {
  font-weight: 400;
  font-synthesis: none;
}
/* 教学气泡文字: 已切黑体 --font-display, 钉 400 Regular 细档 (2026-09-06 二次调整:
   700 偏粗易超框) —— 不被上方 900 追平覆盖。Noto Sans SC/JP Regular 400 有原生字形。 */
:root[lang="ja"] .spotlight-text,
:root[lang="zh-CN"] .spotlight-text {
  font-weight: 400;
  font-synthesis: none;
}
:root[lang="ja"] .item-title,
:root[lang="zh-CN"] .item-title {
  font-weight: 700;
  font-synthesis: none;
}
:root[lang="ja"] :is(.wealth-hud__number, .wealth-hud__unit),
:root[lang="zh-CN"] :is(.wealth-hud__number, .wealth-hud__unit) {
  font-weight: 700;
  font-synthesis: none;
}
/* 按钮统一 display 700 (2026-09 拍板: 层次 称号900 > 按钮700 > 正文400)。
   ZH/JA 下 Noto Sans Bold 700, 不被上方 :root[lang] 900 追平规则覆盖;
   EN Archivo Black 单字重 400 900 范围, 700 命中原生字形。 */
:root[lang="ja"] :is(.primary-button, .dice-button, .spotlight-skip, .spotlight-next, .hero-pill__btn, .hero-endless-btn),
:root[lang="zh-CN"] :is(.primary-button, .dice-button, .spotlight-skip, .spotlight-next, .hero-pill__btn, .hero-endless-btn) {
  font-weight: 700;
  font-synthesis: none;
}
/* 通用轻提示 toast (分享反馈/砂金入账/商品上限等阻断提醒) 钉细 400 ——
   class 含 "share" 会被上方 900 追平规则误伤, 此处钉 400 与 EN 一致 (提醒字弱化, 不抢主视觉)。
   字体栈已在 share-dialog.css .share-toast 显式声明 --font-display (商品卡标题字体)。 */
:root[lang="ja"] .share-toast,
:root[lang="zh-CN"] .share-toast {
  font-weight: 400;
  font-synthesis: none;
}

/* ===== css/ambient.css ===== */
/* 氛围层 只留 body 底色 + grain · 环境光斑已全删
   删除理由：AI-slop 头号信号 · 现 Hero 是全屏视频, 角落 blur 球看不见 */
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  /* 奶油底 + 纯白→浅金→水蓝 连续线性渐变(磨砂玻璃通透感) + grain(唯一手作感氛围)
     层序: grain 在上, 渐变铺满视口(fixed 不随滚动断裂成块), 奶油底垫底 */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0 0.04  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    var(--bg-aqua-glow);
  background-repeat: repeat, no-repeat;
  background-size: 160px 160px, 100% 100%;
  background-position: 0 0, center;
  background-attachment: scroll, fixed;
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  /* FOUT 兜底: 禁止浏览器伪造斜体/粗体,字体加载中系统字回退时更整齐 */
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 氛围层仅保留 body 底色 + grain(见上)。无其他装饰层。 */

/* ===== styles.css ===== */
/* 组件层样式。视觉 token 见 css/tokens.css，页面氛围见 css/ambient.css。
   本文件只写组件本身的 layout / spacing / typography，颜色和阴影都走变量。 */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
button { font: inherit; }

/* ─── Cookies consent · 同意前不加载 GA4，不阻断正常游玩 ─── */
.cookie-banner {
  position: fixed;
  z-index: var(--z-banner);
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(760px, calc(100% - 32px));
  margin-left: auto;
  padding: 18px;
  border: 1px solid rgba(200, 168, 76, 0.34);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(65, 45, 12, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__copy { min-width: 0; }
.cookie-banner__copy strong {
  display: block;
  color: var(--c-ink);
  font-family: var(--font-display);
  font-size: 18px;
}
.cookie-banner__copy p {
  margin: 6px 0 0;
  color: var(--c-ink-soft);
  font-size: 14px;
  line-height: 1.5;
}
.cookie-banner__actions { display: flex; flex: 0 0 auto; gap: 10px; }
.cookie-button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--r-full);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
}
.cookie-button--secondary {
  border: 1px solid rgba(31, 26, 15, 0.18);
  background: transparent;
  color: var(--c-ink);
}
.cookie-button--primary {
  border: 1px solid var(--c-gold-dark);
  background: var(--c-gold-dark);
  color: white;
}
.cookie-settings {
  position: fixed;
  z-index: var(--z-fanfare);
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  padding: 7px 11px;
  border: 1px solid rgba(31, 26, 15, 0.14);
  border-radius: var(--r-full);
  background: rgba(255, 250, 239, 0.88);
  color: var(--c-ink-soft);
  cursor: pointer;
  font-size: 12px;
}
.cookie-settings[hidden] { display: none; }
/* 挑战页单屏布局 · Cookies 入口/弹层不参与游玩态，避免遮挡购买与结算操作 */
body:has(#challengeRoot:not([hidden])) .cookie-settings,
body:has(#challengeRoot:not([hidden])) .cookie-banner { display: none; }

:where(:root[data-layout="mobile"]) {

  /* 移动端 cookies 浮卡 · 压在视频上, 位于底部输入/MAX OUT 操作层上方。 */
  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    left: max(14px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100svh - 132px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow: auto;
    padding: 11px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 38px rgba(16, 12, 6, 0.22);
  }
  .cookie-banner__copy strong { font-size: 13px; line-height: 1.15; }
  .cookie-banner__copy p { margin-top: 4px; font-size: 11px; line-height: 1.32; }
  .cookie-banner__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cookie-button { min-height: 34px; padding: 7px 8px; font-size: 11px; white-space: normal; line-height: 1.12; }

}


/* ─── 触屏 hover 兜底 · 修安卓 Chrome 点击后 hover 状态残留 ───
   媒体查询 hover: none 意味着"设备无悬停能力"(触屏);
   一次性把所有可能残留的 hover transform/背景位移/阴影抬升全清零,
   触屏交互只保留 :active 的按压反馈。 */
@media (hover: none), (pointer: coarse) {
  .primary-button:hover,
  .item-card:hover,
  .item-card[data-danger="true"]:hover,
  .item-card[data-valuable="true"]:hover,
  .item-card:hover .item-emoji,
  .dice-button:hover:not(:disabled),
  .hero-endless-btn:hover,
  .qty-btn:hover:not(:disabled),
  .spotlight-skip:hover {
    transform: none;
    translate: none;
    background-position: initial;
    box-shadow: inherit;
    opacity: inherit;
  }
}

/* ─── 键盘可访问性 · 全局 :focus-visible 描边 ───
   触屏/鼠标点击不显示,仅键盘 Tab 时可见;
   金色 2px + 3px offset,继承圆角以贴合胶囊按钮 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
  border-radius: inherit;
}
/* primary 按钮用 box-shadow ring 叠加,避免 outline 与阴影冲突 */
.primary-button:focus-visible,
.dice-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 168, 76, 0.55), var(--shadow-gold, 0 12px 28px rgba(232,204,122,0.35));
}

.app-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 var(--s-4);
}
/* 挑战区激活后 · app-shell 撑满单屏, 不再为 fixed 结算栏预留底部空白 */
.app-shell:has(#challengeRoot:not([hidden])) {
  padding: 0 var(--s-4);
  height: 100dvh;
  overflow: hidden;
}
/* 挑战区激活后 · 锁死 body 纵向滚动 (2026-09-03 手机端滑商品区整页上移修复):
   iOS 忽略 overscroll-behavior, 快速甩动商品区滚到顶/底时滚动链穿透到 body,
   整页(HUD/倒计时/底栏)被橡皮筋拉走。锁 body overflow 后 body 物理不可滚,
   滚动只发生在 .shop 内部。参照 hero 页已有的 body:has(...) 锁法。 */
body:has(#challengeRoot:not([hidden])) {
  overflow: hidden;
  height: 100vh;
  min-height: 100vh;
}
@supports (height: 100dvh) {
  body:has(#challengeRoot:not([hidden])) {
    height: 100dvh;
    min-height: 100dvh;
  }
}
/* PC · 左右 page margin 加大, 内容不撑满屏宽 */

:where(:root[data-layout="tablet"], :root[data-layout="desktop"]) {

  .app-shell:has(#challengeRoot:not([hidden])) {
    padding: 0 var(--s-7);      /* 48px 左右边距, 页面不撑满 */
  }

}

/* 桌面(仅 PC) · 页框加宽到 1810px。参考 2500×1080 宽屏,核心内容居中占 1810 宽,
   3 列卡片随之变宽、更舒展、宽高比更协调。不改基础 1180px, iPad/mobile 不受影响。 */
:where(:root[data-layout="desktop"]) .app-shell {
  width: min(100%, 1810px);
}


.doodle-inline { color: var(--c-gold); flex-shrink: 0; }

/* ─── 弹窗统一关闭手势 · 可关闭的信息型弹窗右上角圆形 × (决策型弹窗不用) ─── */
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(31, 26, 15, 0.06);
  color: var(--c-ink-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.dialog-close:hover {
  background: rgba(31, 26, 15, 0.12);
  color: var(--c-ink-deep);
  transform: rotate(90deg);
}

/* ─── Hero 显示期间 · body 锁滚动 · 避免露出 app-shell 底部橘黄 · Chrome 105+ / Safari 15.4+ ─── */
body:has(#heroSection:not([hidden])) {
  overflow: hidden;
  height: 100vh;
  min-height: 100vh;
}
@supports (height: 100svh) {
  body:has(#heroSection:not([hidden])) {
    height: 100svh;
    min-height: 100svh;
  }
}

/* ─────────────  Hero 按 KM 全屏活动设计稿规范  ─────────────
   PC 2500×1080(核心 1810×1080) · Mobile 750×1668(核心 750×1256)
   Hero 严格 100vh/100svh 锁死,不露 app-shell 底 · 视频 object-fit: contain 全量展示
   PC 左字 / 右视频 二分区 · Mobile 三段:eyebrow / 视频 / 内容
*/
.hero.hero--v9 {
  position: relative;
  display: grid;
  /* PC 左栏加宽让位给 title 图, 右栏视频收窄 (原 42/58) */
  grid-template-columns: minmax(0, 52vw) minmax(0, 48vw);
  align-items: stretch;
  height: 100vh;
  height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  margin: 0 calc(50% - 50vw) 0;
  padding: 0;
  width: 100vw;
  background: var(--c-bg-elevated);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  isolation: isolate;
}

/* ─── 左栏 · 文字与姓名输入 · 子元素各自 fade-up 依次入场(不再整栏 clip 划入,
   避免开场 ~0.8s 空白死区; 右栏视频仍保留 book-right 划入) ─── */
.hero--v9 .hero-copy-col {
  --hero-action-offset: clamp(56px, 10%, 88px);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center; /* 让内部的 wrapper 居中 */
  justify-content: center;
  gap: clamp(12px, 1.2vw, 20px);
  padding: clamp(40px, 4vw, 80px) 24px;
  z-index: 1;
}

/* 将大图和交互打包在一起；共享左侧对齐基线 */
.hero--v9 .hero-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

/* 大标题 · PC 用图片标题 (Hero页标题.png) · 保留入场动画 */
.hero--v9 .hero-title-lg {
  margin: 0;
  order: 2; /* 排在小字下方 */
}
.hero--v9 .hero-title-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0; /* 撤销单独的左偏移 */
  opacity: 0;
  animation: v9-fade-up 560ms var(--easing-spring-out) 150ms both;
}

/* 副标 · 装饰小字 · 置于页面底部避开操作区 */
.hero--v9 .hero-statement {
  position: absolute;
  bottom: clamp(16px, 3vh, 32px);
  left: calc(24px + var(--hero-action-offset)); /* 与姓名按钮左边缘共用基线 */
  z-index: 10;
  margin: 0;
  white-space: nowrap; /* 强制一行 */
  color: var(--c-ink-soft);
  font-family: var(--font-quote);   /* quote 衬线 (Forum / Noto Serif SC / Shippori Mincho) */
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 400;
  font-synthesis: none;
  text-transform: uppercase;
  letter-spacing: 0.06em; /* 衬线适配收紧 (原 mono 0.15em 太散) */
  opacity: 0;
  animation: v9-fade-up 520ms var(--easing-spring-out) 100ms both;
}
.hero--v9 .hero-statement em {
  font-style: italic;
  font-weight: 700;
  color: var(--c-gold-dark);
}
/* Mobile 专属节点 · 默认隐藏 (fail-safe) ─────────────────────────
   topbar 只在 mobile 档显示 (下方 :where(mobile) 块内 display:flex 打开);
   PC/tablet 档另有 :where 隐藏规则。但首帧若 data-layout 尚未写入 (inline 判定
   脚本被 CSP/扩展拦截、或极端时序), 所有 :where(:root[data-layout=…]) 全不匹配 →
   节点曾以裸 HTML 流漏在页面底部 (首屏闪现裸文本 "Start Shopping Spree…" 的 FOUC)。
   默认 display:none、仅 mobile 档显式打开, 属性缺失时安全降级为不显示。 */
.hero-mobile-topbar { display: none; }
/* 关键词 + 手绘下划弧(doodle-underline-curve) */
.hero--v9 .hs-mark {
  position: relative;
  font-weight: 600;
  white-space: nowrap;
}
.hero--v9 .hs-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.42em;
  width: 100%;
  height: 0.42em;
  stroke: var(--sand-gold);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: draw-hs-underline 900ms var(--ease-out) 1500ms forwards;
}
@keyframes draw-hs-underline { to { stroke-dashoffset: 0; } }

/* 姓名输入 pill · 深墨底 白 ENTER · 无渐变 无发光 */
.hero--v9 .hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: clamp(18px, 2.4vh, 28px) 0 0 var(--hero-action-offset); /* 下移并右移，与新 LOGO 主体起笔对齐 */
  order: 3;
  padding: 6px 6px 6px 22px;
  border-radius: var(--r-full);
  background: var(--c-ink-deep);
  color: #fff;
  opacity: 0;
  animation: v9-fade-up 520ms var(--easing-spring-out) 670ms both;
  /* 与下方 MAX OUT 按钮等长: 统一同一宽度档 (用户要求两按钮等长), 内容 space-between 自适应 */
  width: clamp(264px, 22vw, 304px);
  justify-content: space-between;
}
.hero--v9 .hero-pill__input {
  flex: 1 1 auto;              /* 定宽容器内自适应剩余宽度 */
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  outline: none;
}
.hero--v9 .hero-pill__input::placeholder {
  color: rgba(255, 255, 255, 0.48);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero--v9 .hero-pill__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;             /* 不被 input 压缩 */
  white-space: nowrap;        /* 日文「スタート」不折行 */
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-full);
  background: #fff;
  color: var(--c-ink-deep);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 220ms var(--easing-spring-out);
}
.hero--v9 .hero-pill__btn:hover { background: var(--c-gold-light); }
.hero--v9 .hero-pill__btn:active { transform: scale(0.98); }


/* hero-pill 视觉 · 深墨胶囊 · --font-display uppercase · 无金色边框 · 与 input 同 delay 齐现(修抢跑) */
.hero--v9 .hero-endless-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;   /* 定宽后内容居中, 与 hero-pill 视觉对齐 */
  gap: 8px;
  margin: 16px 0 0 var(--hero-action-offset); /* 与姓名按钮共用左侧基线 */
  order: 4;
  min-height: 42px;
  padding: 0 22px;
  /* 与 hero-pill (玩家名称输入区) 等宽: padding-left 22 + input clamp(140,12vw,180) + gap 6 + btn ~90 + padding-right 6 ≈ 264~304px, 取 clamp 对齐 */
  width: clamp(264px, 22vw, 304px);
  align-self: flex-start;
  border: 0;
  border-radius: var(--r-full);
  background: var(--c-ink-deep);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  animation: v9-fade-up 520ms var(--easing-spring-out) 670ms both;
  transition: background 220ms var(--easing-spring-out);
}
.hero--v9 .hero-endless-btn:hover {
  background: var(--ink-hi);
  transform: none;
}
/* 锁定态 · 未通关 · 灰底不可进(保留 pointer-events 以弹提示) */
.hero--v9 .hero-endless-btn.is-locked {
  background: var(--c-ink-soft);
  color: rgba(255, 255, 255, 0.85);
  cursor: not-allowed;
  opacity: 0;   /* 仍走入场动画淡入; 入场后由动画置 1 */
  animation: v9-fade-up 520ms var(--easing-spring-out) 670ms both;
}
.hero--v9 .hero-endless-btn.is-locked:hover {
  background: var(--c-ink-soft);
}
.hero--v9 .hero-endless-btn.is-locked .hero-endless-high {
  border-left-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.62);
}
/* MAX OUT 入口: 左侧图标(▶/🔒)独立元素 + 右侧标签(main 模式名 + sub 注释)同一行排列。
   用户要求: 文字统一一行 (main 与 sub 同行, 不再上下双行)。 */
.hero--v9 .hero-endless-icon {
  flex: 0 0 auto;
  align-self: center;      /* 与 label 整体垂直居中 */
  font-size: 14px;
  line-height: 1;
}
.hero--v9 .hero-endless-label {
  display: inline-flex;
  flex-direction: row;         /* main + sub 同一行 */
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
  white-space: nowrap;
}
.hero--v9 .hero-endless-sub {
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 400;
  opacity: 0.62;
  white-space: nowrap;
}
.hero--v9 .hero-endless-sub:empty { display: none; }

/* ─── HERO 交互区居中 + 垂直节奏微调 (PC/Tablet, 全语言) ───────────
   用户要求三端统一: 输入框/MAX OUT 按钮与底部 statement 水平居中,
   取消英文版「按钮左缩进对齐横排起笔」(--hero-action-offset)。
   同时拉开 LOGO↔按钮、按钮↔按钮的垂直间距 (默认节奏偏挤)。
   不动 LOGO 宽度; 仅 PC/Tablet, 手机端走另一套全宽堆叠布局不受影响。 */
:where(:root:not([data-layout="mobile"])) {
  /* wrapper 内元素统一居中 (LOGO 满宽不变, 按钮随之居中) */
  .hero--v9 .hero-content-wrapper {
    align-items: center;
  }
  .hero--v9 .hero-pill {
    margin-left: 0;             /* 取消左缩进, 改为居中 */
    margin-right: 0;
    margin-top: clamp(28px, 3.6vh, 40px); /* ~21px → ~32px, LOGO 与按钮间留出呼吸 */
  }
  .hero--v9 .hero-endless-btn {
    margin-left: 0;             /* 取消左缩进, 与输入框同轴居中 */
    margin-right: 0;
    align-self: center;         /* 覆盖 align-self:flex-start */
    margin-top: 18px;           /* 16px → 18px, 两按钮间略松 */
  }
  /* 底部 statement 由左对齐改为居中 (绝对定位: left/right 归零 + 文本居中) */
  .hero--v9 .hero-statement {
    left: 0;
    right: 0;
    text-align: center;
  }
}

/* ─── 中文/日语 MAX OUT 按钮加宽 (PC/Tablet) ──────────────────────
   中日版副标题(不要钱模式/使い放題モード)+成绩区(ベスト 0:52.2)较长,
   默认 clamp(264,22vw,304) 放不下, 成绩区会被右缘截断。中日版加宽按钮。 */
:where(:root[lang=zh-CN]:not([data-layout="mobile"])),
:where(:root[lang=ja]:not([data-layout="mobile"])) {
  .hero--v9 .hero-pill,
  .hero--v9 .hero-endless-btn {
    width: clamp(300px, 26vw, 360px); /* 264~304 → 300~360, 容纳副标题+成绩区 */
  }
}

/* 全局语言切换 · 右上角小地球浮层 (Hero/挑战区均可见, 不被 dialog 遮挡) */
.lang-switcher {
  position: fixed;
  z-index: var(--z-fanfare);
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
.lang-switcher__globe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(31, 26, 15, 0.16);
  border-radius: 50%;
  background: rgba(255, 250, 239, 0.9);
  color: var(--c-ink-soft);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(65, 45, 12, 0.12);
  transition: background 180ms var(--easing-spring-out), color 180ms, transform 180ms;
}
.lang-switcher__globe:hover { background: #fff; color: var(--c-ink); transform: scale(1.06); }
.lang-switcher.is-open .lang-switcher__globe { background: #fff; color: var(--c-ink); }

/* 下拉菜单 */
.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 132px;
  padding: 6px;
  border: 1px solid rgba(31, 26, 15, 0.14);
  border-radius: 14px;
  background: rgba(255, 250, 239, 0.97);
  box-shadow: 0 14px 40px rgba(65, 45, 12, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.lang-switcher__menu[hidden] { display: none; }
.lang-switcher__menu [data-lang] {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms;
}
.lang-switcher__menu [data-lang]:hover { background: rgba(200, 168, 76, 0.14); }
.lang-switcher__menu [data-lang][aria-current="true"] {
  background: var(--c-gold-dark);
  color: #fff;
}
.hero--v9 .hero-endless-high {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.06em;
}
.hero--v9 .hero-endless-high:empty { display: none; }

/* ─── 右栏 · 视频画报 · 关书从右边缘划入 · 视频完整不裁切 ─── */
.hero--v9 .hero-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--c-bg-dark);
  clip-path: inset(0 0 0 100%);
  animation: v9-book-right 900ms var(--easing-spring-out) 80ms both;
}
.hero--v9 .hero-stage__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.04); /* 恢复缩放但不至于像1.08那么大，防黑底 */
  animation: v9-video-zoom 1400ms var(--easing-spring-out) 80ms both;
}

/* ─── 关键帧编排 ─── */
@keyframes v9-book-right {
  from { clip-path: inset(0 0 0 100%); }
  to   { clip-path: inset(0 0 0 0);    }
}
@keyframes v9-video-zoom {
  /* contain 后不再 scale,轻 opacity 淡入避免"闪现"感 */
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes v9-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@media (prefers-reduced-motion: reduce) {
  .hero--v9 .hero-copy-col,
  .hero--v9 .hero-stage,
  .hero--v9 .hero-stage__video,
  .hero--v9 .hero-title-lg,
  .hero--v9 .hero-statement,
  .hero--v9 .hero-pill,
  .hero--v9 .hero-endless-btn {
    animation: none;
    opacity: 1;
    transform: none;
    clip-path: none;
  }
}

/* ─── Mobile 顶部白色遮罩挖字形洞 · 字号跟 PC 拉齐 ─────────
   视频 absolute 铺满 hero · mask panel absolute 顶部 44% · SVG mask 挖字形洞
   Statement + pill 放在遮罩下方视频区上 (paper 底浮层)。
   首屏布局档由 index.html 在 bundle.css 前同步写入 data-layout，后续由 layout-profile.js 维护。 */

:where(:root[data-layout="mobile"]) {

  .hero.hero--v9 {
    display: block;
    position: relative;
    height: 100vh;
    height: 100svh;
    max-height: 100vh;
    max-height: 100svh;
    margin: 0 calc(50% - 50vw) 0;
    padding: 0;
    width: 100vw;
    background: var(--ink);
    overflow: hidden;
  }
  .hero.hero--v9::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: calc(78px + env(safe-area-inset-bottom, 0) + var(--visual-viewport-bottom, 0px));
    background: linear-gradient(to top, #000 0%, #000 22%, rgba(0, 0, 0, 0.72) 48%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
  }

  /* Mobile: 只保留小 Logo + 视频全屏底 (v9 已废弃 mask/footdeck 节点)。 */
  .hero--v9 .hero-statement { display: none; }

  /* 顶部黑底装饰条 · 缩小到一行完整展示 Start Shopping... */
  .hero-mobile-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.38em;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-quote);   /* quote 衬线 (Forum / Noto Serif SC / Shippori Mincho) */
    font-size: clamp(8.6px, 2.42vw, 10.6px);
    font-weight: 400;
    font-synthesis: none;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    animation: v9-fade-down 420ms var(--ease-out) 80ms both;
  }
  .hero-mobile-topbar__text {
    flex: 0 1 auto;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
  }

  .hero--v9 .hero-copy-col { display: contents; }

  /* 视频全屏铺底 · 不再按 9:16 框/底部渐隐计算, 降低首屏跳动。 */
  .hero--v9 .hero-stage {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: none;
    animation: none;
    opacity: 1;
    transform: none;
    background: var(--ink);
    border-radius: 0;
  }
  .hero--v9 .hero-stage__video {
    object-fit: cover;
    object-position: center;
    transform: none;
    animation: none;
    opacity: 1;
    filter: none;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .hero--v9 .hero-stage::after { content: none; }
  .hero--v9 .hero-stage::before { content: none; }

  /* 与 PC 复用同一 logo, 但手机端缩成视频上的轻量品牌层。 */
  .hero--v9 .hero-content-wrapper {
    position: absolute;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(15px + env(safe-area-inset-bottom, 0) + var(--visual-viewport-bottom, 0px));
    z-index: 3;
    display: grid;
    /* 上下两行、各自占满全宽且等长 (用户要求: 两按钮等长, MAX OUT 文字一行放下) */
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    width: auto;
  }
  .hero--v9 .hero-title-lg {
    display: block;
    position: fixed;
    left: 50%;
    top: calc(38px + env(safe-area-inset-top, 0px));
    z-index: 3;
    pointer-events: none;
    width: min(74vw, 324px);
    margin: 0;
    transform: translateX(-50%);
    order: initial;
    filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.48));
  }
  .hero--v9 .hero-title-img {
    width: 100%;
    max-width: 100%;
    opacity: 0;
    animation: v9-fade-down 480ms var(--ease-out) 180ms both;
  }

  /* INPUT / ENTER 与 MAX OUT 上下两行、各占满全宽等长, 直接叠在视频上。 */
  .hero--v9 .hero-pill {
    position: static;
    z-index: auto;
    display: flex;
    width: 100%;             /* 占满整行, 与下方 MAX OUT 按钮等长 */
    min-width: 0;
    min-height: 46px;        /* 与 MAX OUT 按钮同高 */
    margin: 0;
    padding: 4px 4px 4px 13px;
    justify-content: space-between;
    background: #000;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.36);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: v9-fade-up 420ms var(--ease-out) 360ms both;
  }
  .hero--v9 .hero-pill__input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 36px;
    /* iOS 聚焦 input 时 computed font-size < 16px 会强制放大页面 (user-scalable=no 在 iOS 10+ 被忽略),
       表现为输入名字瞬间"glitch"一次 → 必须 ≥16px 从根上阻断。 */
    font-size: 16px;
    letter-spacing: 0.04em;
  }
  .hero--v9 .hero-pill__input::placeholder { letter-spacing: 0.08em; }
  .hero--v9 .hero-pill__btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .hero--v9 .hero-endless-btn {
    display: flex;
    position: static;
    z-index: auto;
    width: 100%;               /* 占满整行, 与上方输入框等长 */
    max-width: none;           /* 去掉 42vw 上限 */
    min-width: 0;
    min-height: 46px;          /* 与输入框同高 */
    margin: 0;
    padding: 0 16px;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(16, 20, 31, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.36);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 13px;
    letter-spacing: 0.04em;
    animation: v9-fade-up 420ms var(--ease-out) 400ms both;
  }
  .hero--v9 .hero-endless-btn.is-locked { background: rgba(89, 86, 82, 0.86); }
  .hero--v9 .hero-endless-icon { font-size: 13px; align-self: center; }
  /* 文字一行: main 与 sub 同一行排列 (flex-direction:row), 不再上下双行 */
  .hero--v9 .hero-endless-label {
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  .hero--v9 .hero-endless-main { white-space: nowrap; }
  .hero--v9 .hero-endless-sub {
    font-size: 10px;
    letter-spacing: 0.08em;
    white-space: nowrap;
    opacity: 0.7;
  }
  .hero--v9 .hero-endless-high { display: none; }

  @supports (height: 100dvh) {
    .hero.hero--v9 {
      height: 100dvh;
      max-height: 100dvh;
    }
  }

}

/* Mobile Hero 只由 data-layout 分档；避免宽度媒体查询与触屏 iPad/桌面档规则分叉。 */

/* 遮罩从顶部下滑入场 */
@keyframes v9-fade-down {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0);     }
}

/* PC 上 mobile 专属节点(装饰条)完全不显示 (双保险: 基础层已默认 display:none) */

:where(:root[data-layout="tablet"], :root[data-layout="desktop"]) {

  .hero-mobile-topbar { display: none; }

}


/* ─── iPad portrait 规范 (761-1024px) ─────────────────────────
   上下分区: 上方品牌+交互 / 下方视频。避免 desktop 52/48 横分在 4:3 屏过窄,
   同时给 title / pill / endless / statement 建立明确的垂直安全区。 */

@media (orientation: portrait) {
:where(:root[data-layout="tablet"]) {

  .hero.hero--v9 {
    grid-template-columns: none;
    grid-template-rows: minmax(430px, 43svh) minmax(0, 1fr);
  }
  .hero--v9 .hero-copy-col {
    justify-content: center;
    padding: clamp(28px, 3.4vh, 40px) clamp(40px, 7vw, 72px);
  }
  .hero--v9 .hero-content-wrapper {
    width: min(100%, 720px);
    margin-inline: auto;
  }
  /* 品牌图在 iPad 不再铺满 720px: 让交互区拥有稳定的下方空间 */
  .hero--v9 .hero-title-img {
    width: min(100%, 620px);
  }
  .hero--v9 .hero-pill,
  .hero--v9 .hero-endless-btn {
    margin-left: var(--hero-action-offset);
  }
  .hero--v9 .hero-endless-btn { margin-top: var(--s-3); }
  /* 装饰落款回归小字, 锚在左栏底部安全区; 不再 22-30px 放大压住按钮 */
  .hero--v9 .hero-statement {
    left: calc(clamp(40px, 7vw, 72px) + var(--hero-action-offset) - 12px);
    right: clamp(40px, 7vw, 72px);
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    width: auto;
    font-size: var(--fs-2xs);
    letter-spacing: 0.12em;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero--v9 .hero-stage { min-height: 0; }

}
}


/* iPad portrait 矮屏: 再压缩上区, 防止按钮与 statement 相撞 */

@media (orientation: portrait) and (max-height: 1024px) {
:where(:root[data-layout="tablet"]) {

  .hero.hero--v9 { grid-template-rows: minmax(400px, 49svh) minmax(0, 1fr); }
  .hero--v9 .hero-copy-col { padding-block: 24px; }
  .hero--v9 .hero-title-img { width: min(100%, 560px); }
  .hero--v9 .hero-pill,
  .hero--v9 .hero-endless-btn { margin-left: var(--hero-action-offset); }
  .hero--v9 .hero-endless-btn { margin-top: var(--s-2); }
  .hero--v9 .hero-statement { bottom: 10px; font-size: 11px; }

}
}

/* ─────────────  Buttons · 扁平实色(承 Hero) · 无渐变 / 无阴影 / 无描边  ───────────── */
.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  border: 0;
  border-radius: var(--r-full);
  padding: 0 var(--s-6);
  /* 按钮统一 display (2026-09 拍板): EN=Archivo Black / ZH·JA=Noto Sans Bold 700,
     与 Hero 入口按钮同族, 消除 body/display 两套并存 */
  font-family: var(--font-display);
  font-weight: 700;
  font-synthesis: none;   /* Archivo Black 单字重 400 900 范围, 700 命中原生字形 */
  font-size: 16px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms var(--easing-out);
}
/* 强调金 · 实色平涂 */
.primary-button {
  color: var(--c-ink-deep);
  background: var(--sand-gold);
}
.primary-button:hover { background: var(--sand-gold-hi); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0) scale(0.98); }
.primary-button.compact {
  min-height: 44px;
  padding: 0 var(--s-4);
  font-size: 14px;
}
/* 结算防抖 · disabled 改明确灰底深字 (金底 disabled 变浅后对比度不足, 易误读为白字) */
.primary-button:disabled {
  opacity: 1;
  cursor: not-allowed;
  transform: scale(0.98);
  background: rgba(31, 26, 15, 0.10);
  color: var(--c-ink-soft);
  transition: background 200ms ease, transform 200ms ease;
}
.primary-button:disabled:hover { transform: scale(0.98); background: rgba(31, 26, 15, 0.10); }

/* Hero 专用大尺寸 CTA */
.primary-button--hero {
  min-height: 64px;
  padding: 0 var(--s-7);
  font-size: 18px;
}

/* 底部操作栏 · 单行 投骰 | 结算 CTA (购物车已删, 任务4) · 去白底包框, 元素落页面背景
   投骰收窄居中放大(顶栏宽度), 结算右侧 · 单屏 flex 列固定 */
.checkout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex: 0 0 auto;               /* 单屏 flex 列里固定不伸缩 */
  padding: 0 4px;               /* 去包框 · 不再圆角白底 */
  background: transparent;
  box-shadow: none;
  /* 区域留白由父 .challenge-root gap 统一控制,不叠加局部 margin (MD §P1-2) */
}
/* 移动端 · 底部栏内部元素间距收紧 (与商品区间距拉大由 challenge.css 控制) */

:where(:root[data-layout="mobile"]) {

  /* (checkout-bar gap 收敛由 challenge.css mobile 档统一管理) */
  /* 冷却态(灰色不可点): 只隐藏"投骰/最后一赌"label, 保留 🎲 + X/Y 剩余次数 + Ns 倒计时。
     2026-09-03: 原把 label+X/Y 都 display:none, 只剩 🎲+小冷却胶囊, 按钮 flex:1 1 auto;
     min-width:0 可无限收缩 → 缩成小胶囊(图3)。保留 X/Y 让按钮有内容撑宽, 不再过度收缩。 */
  .checkout-bar .dice-button:disabled .dice-label { display: none; }
  /* is-last 长文案(最后一赌!+Ns)防超边框 (P2-5)
     手机端两段(投骰|结算)同排, is-last 不收缩会撞边。
     下方全局 .checkout-bar .dice-button.is-last (0,0,2,0) 意图"保完整不收缩"(PC 合理),
     mobile 须覆盖为可收缩 → 用 .is-last.is-last 双类提特异性到 (0,0,3,0) 胜出。 */
  /* 2026-09-04 用户反馈: 手机端投骰到最后一个按钮自动缩短 → 改为与常态一致的 flex,
     不再强制收缩/限宽, 保持按钮宽度全程稳定(宽度由内容自适应, 不再突变)。
     label 移除 ellipsis: is-last 文案「最后一赌!」必须完整显示不省略。
     2026-09-06: 常态 5:3 (投骰 5 / 结算 3), is-last 同步保持 5 份。 */
  .checkout-bar .dice-button.is-last.is-last {
    flex: 5 1 0; /* 投骰 5/8 */              /* 与常态 flex: 5 1 0 一致 */
    max-width: none;
    min-width: 0;
  }
  .checkout-bar .dice-button.is-last .dice-label {
    min-width: 0;
    white-space: nowrap;        /* 完整显示, 不 ellipsis */
  }

}

/* 投骰 · 收窄居中(恢复顶栏宽度感), 视觉主角 · 可收缩防溢出 */
.checkout-bar .dice-button {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 200px;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(230, 169, 76, 0.35);
}
/* PC · 投骰不收缩, "投骰 剩 N 次 Ns" 四段完整显示;
   宽屏(1440+) 限最大宽度 + 居中,让三段视觉聚拢 (MD §P1-6, 修 space-between 悬空) */

:where(:root[data-layout="tablet"], :root[data-layout="desktop"]) {

  .checkout-bar {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  /* 2026-09-06: 底栏 3:1 分配 —— 投骰 3 份, 结算 1 份 */
  .checkout-bar .dice-button { flex: 5 1 0; /* 投骰 5/8 */ max-width: none; min-width: 0; }
  .checkout-cta { flex: 3 1 0; /* 结算 3/8 */ min-width: 0; }
  .checkout-cta .primary-button.compact { width: 100%; }

}

/* PC 专属 · 放大投骰版位，让核心随机操作成为底栏视觉主角。
   1025px 起生效，避免影响手机与 iPad 断点。 */

:where(:root[data-layout="desktop"]) {

  .checkout-bar { max-width: 1180px; }
  .checkout-bar .dice-button {
    /* 2026-09-06: 底栏 3:1 分配 —— 投骰 3 份(原 1 1 360px 360px 长条), 结算 1 份 */
    flex: 5 1 0; /* 投骰 5/8 */
    min-width: 0;
    min-height: 60px;
    padding: 0 var(--s-7);
    border: 1px solid rgba(255, 255, 255, 0.42);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow:
      0 12px 30px rgba(230, 169, 76, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
  .checkout-bar .dice-button .dice-icon { font-size: 28px; }
  .checkout-bar .dice-button .dice-remaining {
    margin-left: var(--s-1);
    font-size: 14px;
  }

}

/* .dice-button.is-last 视觉/尺寸 owner 已迁到 css/challenge.css (与 .dice-button 主定义同处) */
.checkout-bar .dice-button .dice-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 2026-09-06: 底栏 5:3 分配 —— 结算容器占 3/8 宽 (投骰 5/8), 不再 flex 0 0 auto 按内容收缩。
   双类选择器 (0,2,0) 是后续断点覆盖的基准, 此处改弹性后 challenge.css 各断点 1 1 0 才能生效。 */
.checkout-bar .checkout-cta { flex: 3 1 0; /* 结算 3/8 */ min-width: 0; }
.checkout-bar .checkout-cta .primary-button.compact { white-space: nowrap; width: 100%; }
/* MAX OUT MODE: 无购物上限且成交不可撤回, 结算(本就 disabled)无意义 → 隐藏,
   仅留投骰。结算逻辑不受影响 (前4轮自动续/第5轮自动判终局, 见 app.js startEndlessRound)。 */
.challenge-root[data-mode='endless'] .checkout-cta { display: none; }
/* 投骰 is-last 时不再让结算让位收缩 (已删除 .checkout-bar:has(.dice-button.is-last) 规则)。
   用户反馈手机端最后一次投骰按钮宽度突变/缩短 → 移除该规则, 骰子与结算宽度全程保持稳定。
   2026-09-06: 与常态 5:3 一致 —— is-last 也保持结算 3/8 宽, 不再 flex 0 0 auto 收缩。 */
.checkout-bar:has(.dice-button.is-last) .checkout-cta {
  flex: 3 1 0; /* 结算 3/8 */
  min-width: 0;
  overflow: visible;
}

/* 结算 CTA · 只留结算按钮 (预判 settle-preview 与金额进度条 checkout-goal 已收束进顶部目标 bar) */
.checkout-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 手机与 iPad · 结算栏紧凑触控布局 */

:where(:root[data-layout="mobile"], :root[data-layout="tablet"]) {

  .checkout-bar {
    padding: 10px 12px;
    gap: 8px;
  }
  .checkout-cta .primary-button.compact { flex-shrink: 0; }

}


/* iPad 横屏高度有限：结算条压到 60px 内，给商品卡留出更多可操作区域。 */

@media (orientation: landscape) and (max-height: 1024px) {
:where(:root[data-layout="tablet"]) {

  .checkout-bar {
    padding-block: 8px;
  }
  .checkout-cta .primary-button.compact { min-height: 40px; }

}
}


/* 商品区 · 顶部目标与底栏保持可见；高度不足时仅这里轻量滚动。
   顶底 8px mask 渐隐提示"还能滚",避免边缘硬切;PC 保留细金滚动条,mobile/iPad 隐藏。 */
.shop {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* 独占纵向滑动手势 (配合 body 锁滚动, 手机端只滚商品区, 不带动背景)。
     用 manipulation 而非 pan-y: manipulation = pan-x pan-y (保留平移) + 禁双击/双指缩放。 */
  touch-action: manipulation;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 123, 38, 0.34) transparent;
  /* 上下 padding 归零(顶底间距全由 .challenge-root gap 统一, 拉齐倒计时栏↔卡片区↔结算栏);
     左右保留给滚动条 gutter。 */
  padding: 0 6px 0 2px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
}
.shop::-webkit-scrollbar { width: 6px; }
.shop::-webkit-scrollbar-thumb {
  border-radius: var(--r-full);
  background: rgba(184, 123, 38, 0.34);
}

/* ─────────────  Item grid & card  ─────────────
   PC/大屏卡片高度随视口 vh 弹性 (占满商品区红框, 不留大空白);
   PC 端无可变浏览器工具栏, vh 依赖安全。mobile/iPad 走各自断点用 minmax 抗 iOS 抖动。
   shop 视口不足时承担短距离轻量滚动。 */
.item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  /* 撑满 .shop 可用高: 两行按可用高平分(1fr)恒填满红框(无下方空白/无滚动/上下对称),
     保底 200px(极矮屏才触发轻滚)。卡片绝对大小随视口高自适应。 */
  flex: 1 1 auto;
  min-height: 0;
  align-content: stretch;
  grid-auto-rows: minmax(200px, 1fr);
}

.item-card {
  position: relative;
  display: grid;
  /* 图区弹性(购买后收缩让步进器换行) | 标题 auto | 底部价格行 auto · 图文分区明确 */
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: var(--s-2);
  min-height: 0;
  padding: var(--s-3);
  border-radius: var(--r-lg);
  /* 净白实底 · 图区光晕负责蓝金氛围 */
  background: var(--paper-elevated);
  box-shadow: inset 0 0 0 1px rgba(31, 26, 15, 0.06),
              0 6px 18px rgba(31, 26, 15, 0.05);
  transition: translate 220ms var(--easing-spring-out), box-shadow 220ms ease;
  overflow: hidden;
  isolation: isolate;
}
.item-card:hover {
  translate: 0 -2px;
  box-shadow: inset 0 0 0 1px rgba(230, 169, 76, 0.32),
              0 12px 26px rgba(31, 26, 15, 0.08);
}

/* 1亿~<50亿 · 金卡 · 整体金卡面(明显金调), 图区去金晕只留一丝蓝(对齐 mockup R12) */
.item-card[data-valuable="true"] {
  background: linear-gradient(180deg, #FFFDF6 0%, #FBF1D8 100%);
  color: var(--c-ink);
  box-shadow: inset 0 0 0 1px rgba(224, 170, 60, 0.65),
              0 12px 32px rgba(224, 170, 60, 0.20);
}
.item-card[data-valuable="true"]:hover {
  translate: 0 -2px;
  box-shadow: inset 0 0 0 1px rgba(224, 170, 60, 0.85),
              0 18px 42px rgba(224, 170, 60, 0.26);
}
.item-card[data-valuable="true"] .item-title { color: var(--c-ink); }
.item-card[data-valuable="true"] .item-meta  { color: var(--c-ink-soft); }
.item-card[data-valuable="true"] .price      { color: #E39A2E; }   /* 深金(黄金调不红), 浅金底上可读 */
.item-card[data-valuable="true"] .price::before { color: #F2B33D; }
.item-card[data-valuable="true"] .item-image-slot {
  background: var(--glow-slot-gold);
}

/* ≥50亿 · 黑金包装: 深底顶点, 金心蓝缘光晕(青蓝回流闭环) */
.item-card[data-danger="true"] {
  background: var(--ink);
  color: var(--c-ink-on-dark);
  box-shadow: inset 0 0 0 1px rgba(232, 204, 122, 0.24),
              inset 0 1px 0 rgba(126, 199, 242, 0.13),
              0 12px 30px rgba(20, 16, 10, 0.22);
  animation: none;
}
.item-card[data-danger="true"]:hover {
  translate: 0 -2px;
  box-shadow: inset 0 0 0 1px rgba(232, 204, 122, 0.4),
              inset 0 1px 0 rgba(126, 199, 242, 0.2),
              0 16px 38px rgba(20, 16, 10, 0.28);
}
.item-card[data-danger="true"] .item-title { color: var(--c-gold-light); }
.item-card[data-danger="true"] .item-meta  { color: rgba(251, 239, 203, 0.62); }
.item-card[data-danger="true"] .price      { color: var(--c-gold-light); }
.item-card[data-danger="true"] .price::before { color: var(--c-gold); }
.item-card[data-danger="true"] .item-image-slot {
  /* 金心 → 青蓝外缘: 冷暖双光 · 对齐 mockup R12 黑卡 */
  background: radial-gradient(56% 78% at 50% 52%,
                rgba(248, 205, 110, 0.36) 0%,
                rgba(126, 199, 242, 0.14) 52%,
                rgba(0, 0, 0, 0) 86%);
}

/* 隐藏身份角标 · 右上角 · 只显示 Limited */
.item-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(31, 26, 15, 0.3);
}
.item-badge[data-kind="limited"] {
  color: var(--c-ink);
  background: linear-gradient(135deg, var(--sand-gold-hi) 0%, var(--sand-gold) 100%);
}

.item-image-slot {
  position: relative;
  display: flex;
  flex-direction: column;      /* 纵向 · 美术资产下移到图区下部 */
  align-items: center;
  justify-content: flex-end;   /* 美术底部对齐, 上方留白, 大小不变 */
  width: 100%;
  aspect-ratio: 16 / 9;        /* 横版图区 · 保留 16:9 匹配横版美术资产 */
  max-height: 100%;            /* 卡高不足时收缩, 不溢出压文字 */
  min-height: 0;
  padding-bottom: 0;           /* 撤销底部呼吸,美术图铺得更满 */
  border-radius: var(--r-md);
  /* 金蓝晕染胶囊光晕 · 金心→左右晕开成蓝, 让透明 PNG / emoji 浮起 */
  background: var(--glow-slot);
  color: var(--c-ink-soft);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  overflow: hidden;
}
/* 美术素材 · 透明 PNG/WebP 浮于柔雾(contain, 不裁切)
   flex 图区严格收束: 宽高双限 + flex-shrink, 立绘永不溢出压文字 */
.item-art {
  flex: 0 1 auto;
  max-width: 96%;              /* Widget UI 密度: 美术占满图槽 */
  max-height: 94%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(184, 123, 38, 0.20));
}
/* 横版素材: wide 铺满；wideContain 在图区内放大至最大且完整保留横向构图。 */
.item-image-slot[data-art-fit="wide"] .item-art {
  margin-bottom: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-image-slot[data-art-fit="wideContain"] .item-art {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* 角色商品构图锚点：不改变卡片结构，只在图槽内校正主体位置。
   白厄: 保持当前有效画面尺寸，仅小幅右移至视觉居中。
   遐蝶: 维持当前构图位置。
   斯科特: 原图偏竖，按高度放至图区最大，完整保留人物和“Woof”对话框。 */
.item-image-slot[data-art-focus="phainon"] .item-art {
  object-position: 50% center;
}
.item-image-slot[data-art-focus="castorice-ride"] .item-art {
  object-position: center center;
}
/* 斯科特: 原图偏竖, contain 完整保留人物和"Woof"对话框; 垂直居中(2026-09-10 修 MAX OUT MODE 图素偏下)。
   图槽全局 justify-content:flex-end 会让美术贴底, 这里对 skott-bark 槽覆盖为居中。 */
.item-image-slot[data-art-focus="skott-bark"] {
  justify-content: center;
}
.item-image-slot[data-art-focus="skott-bark"] .item-art {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}
.item-emoji {
  font-size: clamp(32px, 9vw, 52px);
  line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(184, 123, 38, 0.22));
}

.item-title  {
  margin: 0;
  font-family: var(--font-display);   /* 卡标题 = EN Archivo Black(与隐藏弹窗标题同源) / ZH·JA Noto Sans Bold 700 */
  font-weight: 700;
  font-synthesis: none;      /* Archivo Black 单字重 400 900 范围, 700 命中原生字形, 防 faux-bold */
  font-size: clamp(14px, 1.7vw, 18px);   /* 文字紧凑, 给图区让空间 */
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--c-ink-deep);
  white-space: nowrap;      /* 恒一行 · 卡高可控, 超出省略 */
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 副标题 · quote 衬线小字 (Forum / Noto Serif SC / Shippori Mincho) · 单行省略, 与结算台词同源 */
.item-meta   {
  margin: 0;
  font-family: var(--font-quote);
  font-weight: 400;
  font-synthesis: none;
  color: var(--c-ink-soft);   /* token 已加深(#57503F) */
  font-size: var(--fs-xs);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price {
  position: relative;
  display: block;
  max-width: 100%;
  padding-bottom: 4px;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums lining-nums;  /* 数字等宽等高 · 跳字不抖 */
  font-feature-settings: "tnum" 1, "lnum" 1;       /* 老引擎兜底 */
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 700;                    /* Space Mono 700 = 真粗体, 非合成加粗, 笔画不糊 */
  color: #D69A12;                      /* 暖橘金(回温) · 白卡价格带金(对齐 mockup R12 红框) */
  letter-spacing: -0.01em;             /* 原 -0.04em 千分位与数字粘连, 放宽 */
  line-height: 1;
  white-space: nowrap;                   /* 价格不换行 */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;               /* 窄卡步进器展开时, 价格侧可省略让位, 不挤出边框 */
  flex-shrink: 1;
}
.price::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: var(--r-full);
  /* 价格下划线: 纯金色 (棕金 → 亮金) */
  background: linear-gradient(90deg, rgba(242, 179, 61, 0.9), rgba(242, 179, 61, 0.18));
  pointer-events: none;
}
.price.is-heart::after { background: linear-gradient(90deg, rgba(255, 140, 105, 0.5), rgba(232, 204, 122, 0)); }
/* 免费 ❤ 商品 (泡泡/说怪话) 价格位显示 ❤ / 【非售品】, 无货币单位 */

/* 卡片底部单行 · 价格 | 操作(2026-09-03 恢复旧版折叠步进器: 默认仅「+」金钮, 购买后展开 −/n/+)
   单屏窄卡: 删除信用点后缀后放大数字, 操作区单行不挤压价格 */
.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;               /* 约束在卡片内, 不被内容撑宽 */
  min-width: 0;              /* 允许 flex 子项收缩, 防溢出 */
  min-height: 36px;          /* 与 + 钮对齐,保留呼吸 */
  margin-top: auto;
}
.item-actions {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;            /* + 钮保持固有尺寸不被压缩, 由价格侧收缩让位 */
  gap: 2px;
  /* 胶囊背景/内边距随 count 切换平滑淡入, 避免布局瞬变 */
  transition: background 200ms ease, padding 200ms ease, gap 200ms ease;
}
/* count=0 折叠态: −/count 宽度归零, gap 也归零, + 钮独占无多余空隙 */
.item-card[data-count="0"] .item-actions { gap: 0; }
/* 购买后(count>0) · 展开为 −/count/+ 步进器 + 胶囊底 */
.item-card:not([data-count="0"]) .item-actions {
  background: rgba(31, 26, 15, 0.05);
  border-radius: var(--r-full);
  padding: 2px;              /* 与 qty-btn 28×28 对齐, 总高 32 */
}

/* .dialog-actions 基础布局 · roundEnd/receipt 弹窗按钮容器 · 具体端内定制走各自弹窗文件 */
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-5); }

/* ───────────── PC · 商品卡排版 (目标比例: 图 58% / 文字 20% / 价格+按钮 13% + padding 9%) ─────────────
   上: 图区(美术居中偏上+上方留白) · 下: 标题/副标题/价格左对齐成组 + 按钮右下 */

:where(:root[data-layout="tablet"], :root[data-layout="desktop"]) {

  /* PC 商品网格 · 卡片按内容自然高度收紧(不撑满/不拉伸出中部留白), 顶对齐;
     两行卡 + gap 通常 < 商品区高 → 不滚, 下方由 .shop 承载呼吸留白。 */
  .item-grid {
    flex: 1 1 auto;
    /* 卡片按内容高, 两行在商品区内垂直居中 → 上下留白对称(呼吸一致);
       内容超高的矮屏自动回退顶对齐可滚(safe), 不切顶部。 */
    align-content: safe center;
    grid-auto-rows: min-content;
    /* 商品之间 padding 加大, 商品区占比放大 */
    gap: var(--s-4);
  }
  .item-card {
    /* 右 padding 加 4px 给底部 + 按钮呼吸,长标题态标题不会顶到边 */
    padding: calc(var(--s-4) + 4px) calc(var(--s-4) + 8px) calc(var(--s-4) + 4px) calc(var(--s-4) + 4px);
    gap: 0;
    /* 内容驱动: 图区(固定高) · 文字(auto) · 价格(auto), 三段按内容紧凑堆叠,
       消除原 1fr 撑开的"名→价格"大留白, 卡片高 = 内容和 (图/文字大小不变) */
    grid-template-rows: auto auto auto;
  }
  /* 图区 · 固定高度保持图片大小恒定(不随卡片/视口拉伸), 美术水平居中 */
  .item-image-slot {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: clamp(150px, 19vh, 200px);   /* 图区放大, 图片随之放大 */
    aspect-ratio: auto;
    /* 不再去柔雾底: PC 端同样保留蓝金/纯金光晕, 视觉与白卡设计稿一致 */
  }
  .item-art { max-height: 100%; max-width: 90%; }  /* 美术占满固定图区 */
  /* 姬子：从腰部起放大；以顶部为缩放锚点，发饰/头部保持在安全区内。 */
  .item-card[data-item-id="himeko_brew"] .item-art {
    max-width: none;
    max-height: none;
    width: 122%;
    height: 122%;
    object-fit: contain;
    object-position: center top;
    translate: 0 7%;
  }
  /* 白厄/遐蝶保留完整白框，wideContain 的 100% 尺寸不受通用 90% 限制。 */
  .item-image-slot[data-art-focus="phainon"] .item-art,
  .item-image-slot[data-art-focus="castorice-ride"] .item-art {
    width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  }
  .item-emoji { font-size: clamp(64px, 6vw, 88px); }  /* icon 填满图区 */

  /* 文字区 · 标题/副标题全左对齐; 与图区留出更明显 padding */
  .item-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;    /* 左对齐 (参考图) */
    gap: 4px;                   /* 标题↔副标题 分层更清晰 */
    margin-top: var(--s-4);     /* 图→文 16px, 让标题再下移一档 */
    width: 100%;
  }
  .item-title {
    line-height: 1.15;
    text-align: left;
    width: 100%;
    /* PC 回退到上一版字号；iPad 在后续 tablet override 保持放大版 */
    font-size: clamp(19px, 2.2vw, 24px);
  }
  /* 显式长标题允许折 2 行；所有标题保持同一字号。
     图区比例已统一 52% (不再按长标题差异化), 保证所有卡文字起点对齐。 */
  .item-card[data-long-title="true"] .item-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* 副标题 · PC 放行 2 行 line-clamp, 长文案完整展示 (基础态 nowrap+ellipsis 在此断点被覆盖) */
  .item-meta {
    /* PC 回退到上一版字号；iPad 在后续 tablet override 保持放大版 */
    line-height: 1.3;
    font-size: clamp(12px, 1.2vw, 14px);
    text-align: left;
    width: 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* 价格+按钮行 · 价格左下, 按钮右下与价格居中对齐 */
  .item-foot {
    min-height: 44px;           /* 容纳 count=0 大 + 钮(38) + 2px 胶囊 padding, 消除展开跳动 */
    gap: var(--s-2);
    margin-top: var(--s-2);     /* 文字组与价格 8px 间距 */
    align-items: center;
  }
  /* PC 价格 · 回退到上一版字号 */
  .price { font-size: clamp(19px, 2.1vw, 26px); }
  /* PC/iPad + 主加钮 38px: 仅 count=0(默认单金钮态) 放大; 展开为步进器后回 challenge.css card-buy 32px 档。
     特异性必须 > challenge.css 更晚加载的同 selector 32px 金钮。本媒体段用 :where() 包根(特异性 0),
     故需双写 [data-count="0"] 把属性选择器×2 → (0,4,1) 稳赢 challenge 的 (0,3,1)。
     不显示数量角标 (步进器中央 count 已表达件数)。 */
  .item-card[data-count="0"][data-count="0"] .qty-btn[data-role="plus"] {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
  /* PC/iPad 不显示数量角标 (PC 卡布局不变, 角标仅手机端) */
  .item-card .qty-badge { display: none; }

}

/* iPad 保持上版提交的放大字号；本次仅回退 desktop。 */
:where(:root[data-layout="tablet"]) {

  .item-title { font-size: clamp(22px, 2.6vw, 30px); }
  .item-meta  { font-size: clamp(14px, 1.4vw, 17px); }
  .price      { font-size: clamp(22px, 2.4vw, 32px); }

}


/* ───────────── Responsive · 商品网格/卡片/结算栏 · 单屏禁滚 ─────────────
   移动端: 卡内收紧 (padding/间距/行距), 区域之间拉开 (见 challenge.css gap) */

:where(:root[data-layout="mobile"]) {

  .app-shell:has(#challengeRoot:not([hidden])) { padding: 0 var(--s-3); }
  .shop {
    padding-right: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .shop::-webkit-scrollbar { display: none; }
  /* ── Mobile · 双列纵向滚动 · 卡片放大 readable ──
     旧: 148–195px 死行高把卡片压小, 一屏装完不滚动, 图/字都难看清。
     新: 卡片按内容撑开 + 232px min-height 兜底, 图区 4:3 占 ~50%,
         文字/价格全放大, 一屏装不下 → .shop(overflow-y:auto) 进入纵向滚动。
     倒计时 / 底部结算 / 弹窗居中逻辑不变 (仅商品区滚动)。 */
  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;                 /* 14→10 (2026-09-04 用户反馈: 卡间距偏大浪费空间) */
    /* 卡片同尺寸: 同行卡同高(1fr 均分行高 + 卡片 stretch),
       文字行数差异由卡片自然撑高吸收(标题/副标题完整显示不截断)。
       minmax(min-content,1fr): 内容(图区+完整标题+完整副标题+价格)是下限保底不重叠,
       同行卡再 1fr 均分取齐 → 同尺寸且内部不溢出。 */
    grid-auto-rows: minmax(min-content, 1fr);
    align-content: start;                          /* 顶部对齐, 不再拉伸填满 shop 高 */
    padding-bottom: var(--s-3);                    /* 末行底部呼吸, 滚动到底不贴边 */
  }
  .item-card {
    /* 2026-09-03 拉长卡片: 用户反馈 3 行标题+2 行副标题时副标题被压得看不清,
       整体竖向加 padding/间距让卡更长、文字区更舒展 (卡高由 grid 行 min-content 吸收, 超出走 .shop 纵向滚动) */
    padding: 16px 14px;
    gap: 10px;
    /* 卡高由 grid 行统一(同行同高), 内部三段: 图区(固定宽高比) / 文字(预留固定行高) / 价格行。
       align-self:stretch 让卡填满所在行 → 同尺寸; 文字完整显示不截断。 */
    grid-template-rows: auto auto auto;
    align-self: stretch;        /* 填满 grid 行, 与同行卡同高 (原 start 按内容撑 → 大小不一) */
    min-height: 0;
    min-width: 0;               /* 允许收缩, 长内容不撑破列宽 */
  }
  /* 图区 · 从 21:10 放宽到 16:10 (2026-09-03 用户要求: 放大商品图片区域),
     让美术视觉占比更高; 标题/副标题字号同步缩一档腾出纵向空间
     覆盖 base max-height:100% (在 grid auto 行里会形成循环依赖塌陷)
     2026-09-03 拉高: 16/10→3/2, 卡片整体拉长, 3行标题+2行副标题下副标题更清楚 */
  .item-image-slot {
    aspect-ratio: 3 / 2;
    width: 100%;
    height: auto;
    max-height: none;                              /* 解锁 base 100% 上限, 让 aspect-ratio 生效 */
    min-height: 0;
    justify-content: center;
    border-radius: var(--r-md);
  }
  /* 美术图放大 (80→92%), 充分利用新图区 */
  .item-art { max-height: 92%; max-width: 92%; }
  /* 姬子：移动端同样拉近至腰部起，头部从顶部安全区完整露出。 */
  .item-card[data-item-id="himeko_brew"] .item-art {
    max-width: none;
    max-height: none;
    width: 122%;
    height: 122%;
    object-fit: contain;
    object-position: center top;
    translate: 0 7%;
  }
  .item-image-slot[data-art-focus="phainon"] .item-art,
  .item-image-slot[data-art-focus="castorice-ride"] .item-art {
    width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  }
  .item-emoji { font-size: clamp(52px, 14vw, 72px); }
  /* 文字区 · 标题/副标题放大, 完整显示 (readability 关键)
     2026-09-03 拉长卡片: 图→文留 6px 呼吸 + 标题↔副标题 5px, 多行文字不再拥挤 */
  .item-info {
    gap: 5px;
    margin-top: 6px;
    margin-bottom: 0;
    min-height: 0;
    min-width: 0;                                  /* 允许收缩, 防止子元素撑破 */
    width: 100%;
  }
  /* 标题 · 完整可见不截断 (2026-09-03 用户: 文字截断绝对不行)。
     删步进器腾出横向空间后, 卡片按需拉长容纳完整标题; 去掉 line-clamp 与固定行高预留,
     标题几行就显示几行。长标题(如 Nihilux's ...)完整换行显示, 不再 ellipsis。 */
  .item-title {
    font-size: clamp(11px, 3vw, 13px);
    line-height: 1.3;                              /* 1.25→1.3: 多行标题行间更松 */
    font-weight: 700;
    white-space: normal;                           /* 允许折行 */
    overflow: visible;                             /* 不截断 */
    max-width: 100%;
    min-height: 0;                                 /* 不预留固定行高, 按内容自然撑 */
  }
  /* 副标题 · 完整可见不截断 (同标题), 无副标题的卡不占空行 */
  .item-meta {
    font-size: clamp(9px, 2.3vw, 10px);            /* 副标题缩小(用户要求), 让位价格/更紧凑 */
    line-height: 1.35;                             /* 1.25→1.35: 2 行副标题拉开行距, 小字不再糊成一团 */
    color: var(--c-ink-soft, rgba(31,26,15,0.55));
    white-space: normal;                           /* 允许折行 */
    overflow: visible;                             /* 不截断 */
    max-width: 100%;
    min-width: 0;
    min-height: 0;                                 /* 无副标题卡不占空行 */
  }
  /* 底部 · 价格显示完整千分位数字 (用户要求: 不用亿/万缩写)。
     2026-09-03 步进器再精简: 手机端删 + 钮(购买靠点整卡), foot 只剩价格 → 收紧高度让卡更紧凑。 */
  .item-foot {
    gap: 6px;
    min-height: 0;             /* 无 + 钮占位, foot 高度由价格行决定 */
    align-items: center;
  }
  .price {
    font-size: clamp(14px, 4vw, 16px);             /* 12/14→14/16 (2026-09-04 用户反馈: 金额识别度差); Space Mono 字面窄, 提一档更清晰 */
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  /* 手机端隐藏 + 购买钮 (省出版位让卡更紧凑; 点整卡仍可购买) */
  .item-card .item-actions { display: none; }
  /* 数量角标 · 浅金底, 贴卡片右下角内壁。坐标/底色继承 challenge.css 基础规则。
     不再负值外凸: 卡片 overflow:hidden+圆角, 角标任何外凸部分都会被卡片自身圆角裁掉
     (z-index 无法跳出 .item-card 的 isolation:isolate 堆叠上下文) → 改成完整贴在卡片内右下,
     外缘圆角(9px)贴卡片 r-lg 弧内壁, 仍是「角落印章」观感且 100% 可见不被遮。 */
  /* 2026-09-03 修: 去白描边改阴影(用户要求); 内移 1px 让完整露出不被卡圆角裁边,
     padding 0 6px + line-height 1 + flex 居中修数字截断(原 line-height:20 定死易裁)。 */
  .item-card .qty-badge {
    right: 1px;
    bottom: 1px;
    border: 0;                              /* 去白描边, 只留阴影 (覆盖 challenge.css 基础规则的 border) */
    border-radius: var(--r-full) 0 8px 0;   /* 外下缘贴卡片圆角内壁, 其余圆角 */
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(31, 26, 15, 0.35);   /* 阴影分离, 替代白描边 */
  }

  /* LIMITED 角标缩小+内收, 避免覆盖标题 (任务2) */
  .item-badge {
    top: 6px;
    right: 6px;
    padding: 2px 7px;
    font-size: 8px;
    letter-spacing: 0.08em;
  }

}


/* ═══════════════════════════════════════════════════════════
   PC(desktop) 专属收紧 · 配合 .app-shell 加宽到 1810px:
   把顶部/焦点栏/卡片的垂直占用收紧、卡片内间距收拢,
   让「财富条 + 焦点栏 + 商品网格 + 投骰栏」所有内容在 1080 高度内
   完整显示、不被裁切、不滚动。仅匹配 desktop, 不影响 iPad/mobile。
   数值均可再微调(告诉我"再紧一点/松一点"即可)。
   ═══════════════════════════════════════════════════════════ */
:where(:root[data-layout="desktop"]) {
  /* 竖向留白收紧, 把高度还给商品区 */
  .challenge-root { gap: var(--s-3); padding-top: var(--s-2); }
  /* 焦点栏(倒计时/进度条) 更扁 */
  .focus-bar { padding: var(--s-2) var(--s-5); }
  /* 商品网格行间距略收 */
  .item-grid { gap: var(--s-3); }
  /* 卡片内边距 + 内部间距收拢, 让图/文/价在更矮的行高里完整容纳 */
  .item-card { padding: var(--s-4); }
  .item-info { margin-top: var(--s-2); }
  .item-emoji { font-size: clamp(44px, 6vh, 72px); }
  .item-foot { min-height: 40px; margin-top: var(--s-1); }
}

/* ═══════════════════════════════════════════════════════════
   PC(desktop) · 底部结算栏按钮优化:
   ① 结算 与投骰按钮等高(60px)、内边距更大 → 更饱满醒目;
   ② 投骰保持原"长版本"(拉伸填满中间, flex:1 1 360, 见上方 864 段),
      投骰/结算在两侧, 按钮间距加大且不贴左右边缘。
   仅匹配 desktop, 不影响 iPad/mobile。数值可再微调。
   ═══════════════════════════════════════════════════════════ */
:where(:root[data-layout="desktop"]) {
  .checkout-bar {
    gap: var(--s-6);           /* 按钮间距加大到 32px */
    padding: 0 var(--s-5);     /* 左右各内缩 24px, 不贴边 */
  }
  /* 结算 CTA · 与投骰等高、更醒目 */
  .checkout-cta .primary-button.compact {
    min-height: 60px;
    padding: 0 var(--s-6);     /* 32px 横向 */
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== css/interactions.css ===== */
/* 爽感层。按压反馈 / 徽章 / 差距抖动 / 飘字粒子 / Bento 网格。
   本文件不写颜色 hex,只调用 tokens 变量 + 新增仅用于交互动效的 keyframes。 */

/* PREMIUM 徽章移除 · 非隐藏卡视觉统一 · 只 hidden 卡有 LIMITED 蜡封做差异 */

/* ─────────────  卡片交互动效 · 排版见 styles.css .item-card ───────────── */
/* emoji 倾斜基础角 + hover 摆动 (font-size/filter 在 styles.css .item-emoji 定义) */
.item-emoji {
  position: relative;
  z-index: var(--z-raised);
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif;
  transform: rotate(-4deg);
  transition: transform 380ms var(--easing-bounce);
}
.item-card:hover .item-emoji { transform: rotate(4deg) scale(1.08); }

/* 商品进场 · stagger 60ms · 6 卡依次上浮淡入 */
.item-card.is-entering {
  animation: item-enter 520ms var(--easing-spring-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes item-enter {
  0%   { opacity: 0; transform: translateY(14px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    }
}
@media (prefers-reduced-motion: reduce) {
  .item-card.is-entering { animation: none; }
}

/* 价格行 & 独立 BUY 按钮已移除 · 改为 .item-foot(价格|操作) + 渐进式步进器(见 styles.css) */

/* 购买反馈不移动整卡，避免标题在手机端重栅格化；卡面阴影与描边负责成交闪光。 */
.item-card.is-bought {
  animation: card-purchase-flash 220ms ease-out;
}
@keyframes card-purchase-flash {
  0%   { box-shadow: inset 0 0 0 2px rgba(230, 169, 76, 0.78), 0 14px 30px rgba(184, 123, 38, 0.24); }
  55%  { box-shadow: inset 0 0 0 1px rgba(230, 169, 76, 0.38), 0 9px 22px rgba(184, 123, 38, 0.13); }
  100% { box-shadow: inset 0 0 0 1px rgba(31, 26, 15, 0.06), 0 6px 18px rgba(31, 26, 15, 0.05); }
}
@media (hover: none), (pointer: coarse) {
  /* 仅让图片区短促跳动，标题/价格/卡片外框保持静止。 */
  .item-card.is-bought .item-image-slot {
    animation: card-purchase-art-hop 160ms ease-out;
  }
}
@keyframes card-purchase-art-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  42%      { transform: translateY(-4px) scale(1.02); }
  76%      { transform: translateY(1px) scale(0.997); }
}

/* 单件每轮上限: 达上限的卡片降饱和 + 「+」禁用, 提示本轮不能再买这件 */
.item-card[data-item-capped='true'] {
  filter: grayscale(0.5);
  opacity: 0.72;
}
.item-card[data-item-capped='true'] .qty-btn[data-role='plus'] {
  opacity: 0.4;
  pointer-events: none;
}

/* SOLD OUT 售罄角标 · 与 .item-badge(Limited) 同款右上角胶囊, 仅换红底白字 (Discord mod 反馈: 仅置灰看不出哪件不能再买)。
   定位/尺寸/字距全继承 styles.css 的 .item-badge 基类, 这里只覆盖配色; 手机端缩小由基类的 mobile 规则统一管。 */
.item-badge[data-kind='soldout'] {
  color: #fff;
  background: var(--c-danger);
}

/* ─────────────  最后 10 秒救场指引 · 只做金色呼吸描边与箭头，不额外堆叠文案  ───────────── */
.item-card.is-last-chance-target,
.dice-button.is-last-chance-target {
  position: relative;
  z-index: var(--z-raised);
  /* inset shadow 不越出 card/shop 的 overflow 裁切边界；外框效果完整保留在卡片内部。 */
  box-shadow:
    inset 0 0 0 3px var(--c-gold),
    inset 0 0 0 7px rgba(230, 169, 76, 0.18),
    inset 0 0 22px rgba(230, 169, 76, 0.34);
  animation: last-chance-pulse 1.1s ease-in-out infinite;
}
@keyframes last-chance-pulse {
  0%, 100% { box-shadow: inset 0 0 0 3px var(--c-gold), inset 0 0 0 7px rgba(230, 169, 76, 0.16), inset 0 0 22px rgba(230, 169, 76, 0.3); filter: brightness(1); }
  50% { box-shadow: inset 0 0 0 3px #fff2b8, inset 0 0 0 8px rgba(230, 169, 76, 0.28), inset 0 0 28px rgba(230, 169, 76, 0.5); filter: brightness(1.05); }
}
.last-chance-arrow {
  position: fixed;
  z-index: var(--z-spotlight);
  color: var(--c-gold);
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  /* 2026-09-03 fix 轻微截断: ↓ 字符在 mono 字体 900 字重下字面 bbox 略超内容盒,
     且 text-shadow 3px 外扩 + bob 动画 translate 上下 6px 摆幅,
     没有 padding 时箭头顶/底/右易被裁切(尤其贴近屏幕/卡片边缘时)。
     padding 给字符+投影完整渲染空间; display:inline-block 确保 padding 生效。 */
  padding: 4px 8px 8px;
  display: inline-block;
  pointer-events: none;
  transform: translateX(-50%);
  text-shadow: 0 3px 8px rgba(31, 26, 15, 0.3);
  animation: last-chance-arrow-bob 0.9s ease-in-out infinite;
  /* 箭头上跳不截断: 最高点 -2px 再加上 padding-top 4px, 距父级顶 6px 安全 */
  will-change: translate;
}
@keyframes last-chance-arrow-bob {
  0%, 100% { translate: 0 0; }        /* 原 -2px 起跳会把字符顶到 padding 外, 改为 0 起跳 */
  50% { translate: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .item-card.is-last-chance-target,
  .dice-button.is-last-chance-target,
  .last-chance-arrow { animation: none !important; }
}

/* ─────────────  飘字粒子层  ───────────── */
#fx-float-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  pointer-events: none;
}
.fx-float {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  opacity: 0;
  transition: transform 780ms var(--easing-out), opacity 780ms ease;
  will-change: transform, opacity;
}
/* 玩家扣钱 · 红色 */
.fx-float[data-tone='minus'] {
  color: var(--c-danger);
  text-shadow: 0 1px 4px rgba(230, 57, 70, 0.18);
}
/* 砂金入账 · 金色 */
.fx-float[data-tone='plus'],
.fx-float:not([data-tone]) {
  color: var(--c-gold-dark);
  text-shadow: 0 1px 4px rgba(232, 204, 122, 0.32);
}
.fx-float.is-flying {
  transform: translate(-50%, -80px) scale(0.95);
  opacity: 0;
  animation: fx-float-fade 780ms var(--easing-out) both;
}
/* 财富数字旁的支出动画 · 玩家花钱 -价格 · 数字右侧向上淡出 */
.fx-float--spent {
  font-size: 13px;            /* 比商品卡红字 (11px) 大一档, 顶部 HUD 旁更显眼 */
  font-weight: 800;
}
.fx-float--spent.is-flying {
  animation: fx-float-spent 820ms var(--easing-out) both;
}
@keyframes fx-float-spent {
  0%   { opacity: 0; transform: translate(0, 4px)      scale(0.9); }
  20%  { opacity: 1; transform: translate(0, -6px)     scale(1.05); }
  100% { opacity: 0; transform: translate(6px, -52px)  scale(0.95); }
}
/* PC / iPad 端再放大一档 (数字本身就大, 支出提示要匹配) */
:where(:root[data-layout="desktop"], :root[data-layout="tablet"]) .fx-float--spent {
  font-size: 17px;
}

@keyframes fx-float-fade {
  0%   { opacity: 0; transform: translate(-50%,  -10px) scale(0.9); }
  20%  { opacity: 1; transform: translate(-50%,  -24px) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -80px)  scale(0.95); }
}
:root[data-layout="mobile"] .fx-float {
  text-shadow: none;
  transition-duration: 520ms;
}
:root[data-layout="mobile"] .fx-float.is-flying {
  animation-duration: 520ms;
}
:root[data-layout="mobile"] .fx-float--spent.is-flying {
  animation-duration: 560ms;
}

/* reduced-motion 统一兜底 · 关掉所有装饰动效, 交互过渡保留最基础的 */
@media (prefers-reduced-motion: reduce) {
  .pulse-dot,
  .wealth-hud__number,
  .ticker-strip__track,
  .dice-button:hover:not(:disabled),
  .dice-button.is-rolling .dice-icon,
  .focus-converge__track.is-cleared .focus-converge__fill,
  .focus-bar .countdown-display[data-phase='danger'],
  .item-card.is-bought .item-image-slot {
    animation: none !important;
  }
  .item-card,
  .item-card:hover,
  .primary-button,
  .primary-button:hover,
  .qty-btn {
    transition: none !important;
    transform: none !important;
  }
}

/* ===== css/ticker-and-progress.css ===== */
/* 传播层。收据票据 RECEIPT。
   视觉严格取 tokens.css, 对齐 Hero: paper-elevated + 细描边 + 字体三件套。 */

/* ═════════════  收据票据 RECEIPT (结算 = 分享同一视觉)  ═════════════ */
/* 三段式(桌面/移动统一): 机头固定 → 票据内部滚动 → 按钮固定底部。
   无论商品/称号多少, 全部内容可滚动查看且底部按钮永远可见。宽度加宽以容纳两列。 */
.receipt-dialog {
  width: min(calc(100% - 32px), 660px);
  max-height: 92vh;
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}
.receipt-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.receipt-dialog form {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  min-height: 0;
}
.receipt-dialog .printer { flex: 0 0 auto; }   /* 机头固定顶部 */

/* 票据纸 · 奶油纸 + 底部齿孔撕边 · 打开时"打印吐出"动画 · 唯一滚动区
   左右 margin 缩进让打印机机头视觉上包住票据两侧(比机头窄 20px×2) */
.receipt-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;   /* 滚到边界不带动背景商品页 */
  scrollbar-width: thin;          /* 收据纸上滚动条克制 */
  scrollbar-color: rgba(184, 123, 38, 0.4) transparent;
  margin: 0 20px;
  padding: var(--s-6) var(--s-5) var(--s-5);
  background: var(--paper);
  box-shadow: 0 32px 96px rgba(31, 26, 15, 0.32);
}
.receipt-body::-webkit-scrollbar { width: 6px; }
.receipt-body::-webkit-scrollbar-thumb { background: rgba(184, 123, 38, 0.4); border-radius: 3px; }

/* iPad Safari 的 dialog 也要以动态可视高度为准；横屏工具栏出现时 92vh 会把底部操作挤出屏幕。 */

:where(:root[data-layout="tablet"]) {

  .receipt-dialog,
  .receipt-dialog form {
    max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
  .receipt-dialog .dialog-actions {
    padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px));
  }

}


/* Mobile: dialog 撑满屏 (三段式已是基础布局, 这里只做满屏尺寸 + 单列覆盖) */

:where(:root[data-layout="mobile"]) {

  .receipt-dialog {
    width: 100vw;
    max-width: none;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0 auto auto;
    inset: 0 auto auto 0;
    overflow: hidden;
  }
  .receipt-dialog form { height: 100dvh; max-height: 100dvh; }
  .receipt-body { margin: 0 22px; }
  .receipt-dialog .dialog-actions {
    margin: 0;
    padding: var(--s-3) var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom, 0));
  }
  .receipt-dialog .printer__body {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding-top: calc(20px + env(safe-area-inset-top, 0));
  }
  .receipt-dialog .printer__brand { font-size: 18px; white-space: nowrap; }
  .receipt-dialog .printer__slot {
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

}

/* 打印吐出 · 顶部连打印机(固定), 从上往下匀速"打印"展开; 无位移跳动, 更从容 */
.receipt-dialog[open] .receipt-body {
  transform-origin: top center;
  animation: receipt-print 900ms var(--ease-out) both;
}
@keyframes receipt-print {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 -14px 0); }
}
@media (prefers-reduced-motion: reduce) {
  .receipt-dialog[open] .receipt-body { animation: none; clip-path: none; }
}
/* 底部撕纸齿孔 · 位于整张票据(含按钮页脚)的最底边 · 不随内部滚动裁掉
   (票据体现在是滚动区, 齿孔挂在固定的按钮页脚底部) */
.receipt-dialog .dialog-actions::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -5px;
  height: 10px;
  background-image: radial-gradient(circle at 7px 5px, transparent 5px, var(--paper) 5.5px);
  background-size: 14px 10px;
  background-repeat: repeat-x;
  transform: scaleY(-1);
  z-index: 2;
  pointer-events: none;
}

/* ═══ 单行双汇合进度条 · 与局内 focus-converge 同款 (金额 + 彩蛋) ═══
   左 fill 金渐变(左→中, max 50%) · 右 fill 桃橙渐变(右→中, max 50%) · 中点菱形会师刻度。 */
.rcpt__converge {
  min-width: 0;
}
.rcpt__converge-heads {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-3);
  margin-bottom: 8px;
}
.rcpt__converge-head {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.rcpt__converge-head--right { justify-items: end; text-align: right; }
.rcpt__converge-label {
  font-family: var(--font-display);
  font-size: clamp(12px, 2.8vw, 14px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--c-ink-soft);
  white-space: nowrap;
}
.rcpt__converge-value {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 800;
  font-size: clamp(12px, 3.1vw, 15px);
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rcpt__converge-head--left .rcpt__converge-value { color: var(--c-gold-dark); }
.rcpt__converge-head--right .rcpt__converge-value { color: var(--c-gold-dark); }
.rcpt__converge-track {
  position: relative;
  height: 10px;
  border-radius: var(--r-full);
  background: rgba(31, 26, 15, 0.07);   /* 与局内一致: 浅透轨道 · 无内阴影(去 3D) */
  overflow: hidden;
}
.rcpt__converge-fill {
  position: absolute;
  top: 0;
  height: 100%;
  /* --pct 为 0~100 的全量百分比, fill 占半边轨道的宽度 = pct/2 (max 50%) */
  width: calc(var(--pct, 0%) / 2);
  max-width: 50%;
  transition: width 900ms var(--ease-out);
}
/* 左 fill · 金额: 亮白金→金 (左→中), 与局内 --grad-amt 同款 */
.rcpt__converge-fill--left {
  left: 0;
  border-radius: var(--r-full) 0 0 var(--r-full);
  background: var(--grad-amt);
  box-shadow: 0 0 8px rgba(242, 205, 126, 0.5);
}
/* 右 fill · 彩蛋: 亮蓝→金 (右→中), 与局内 --grad-egg 同款 */
.rcpt__converge-fill--right {
  right: 0;
  border-radius: 0 var(--r-full) var(--r-full) 0;
  background: var(--grad-egg);
  box-shadow: 0 0 8px rgba(226, 201, 142, 0.45);
}
/* 中点菱形刻度 · 会师目标线 (暖亮金, 同局内) */
.rcpt__converge-mid {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--c-gold-warm);
  border-radius: 2px;
  transform: rotate(45deg);
  z-index: 2;
  box-shadow: 0 0 0 2px var(--paper), 0 0 8px rgba(232, 168, 69, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .rcpt__converge-fill { transition: none; }
}

:where(:root[data-layout="mobile"]) {

  .rcpt__converge-heads { gap: var(--s-2); }
  .rcpt__converge-value { font-size: 11px; }
  /* 窄屏适当缩小明细字号, 让长商品名单行放得下 */
  /* 双类提特异性, 胜过下方 base 的 .rcpt__row (源码更靠后) */
  .rcpt__row.rcpt__row { font-size: var(--fs-2xs); padding: 1px 0; line-height: 1.25; }

}

.rcpt__row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  padding: 2px 0;              /* 收紧行距, 缩短整列高度 */
  font-size: var(--fs-xs);     /* 字号收小 (14→13) */
  line-height: 1.3;
}
/* 商品名 · 优先展示全文: 不设宽度上限, 需要时换行(不省略号截断) */
.rcpt__rowname {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.rcpt__rowname em {
  margin-left: 4px;
  font-style: normal;
  font-size: var(--fs-3xs);
  color: var(--c-ink-soft);
}
.rcpt__rowdots {
  flex: 1 1 auto;
  min-width: 12px;
  transform: translateY(-4px);
  border-bottom: 1px dotted rgba(107, 100, 85, 0.5);
}
.rcpt__rowamt {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--c-gold-dark);
  font-variant-numeric: tabular-nums;
}

/* 可点击明细行 · 点击浮现商品当时图片 */
.rcpt__row--tap {
  cursor: pointer;
  border-radius: var(--r-sm, 8px);
  transition: background 160ms ease;
}
.rcpt__row--tap:hover,
.rcpt__row--tap:focus-visible {
  background: rgba(184, 123, 38, 0.1);
  outline: none;
}
.rcpt__row--tap:focus-visible { box-shadow: 0 0 0 2px rgba(184, 123, 38, 0.5); }

/* ═══ 商品图弹窗 · 结算页内浮层 (点击明细行浮现) ═══ */
.rcpt-item-popover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
}
.rcpt-item-popover__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: transparent;              /* 去掉暗色遮罩, 只保留背景模糊 */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms ease;
}
.rcpt-item-popover.is-open .rcpt-item-popover__backdrop { opacity: 1; }
.rcpt-item-popover__card {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  width: min(72%, 268px);                 /* 收窄成小卡, 对齐隐藏商品揭示弹窗尺度 */
  padding: var(--s-5) var(--s-4) var(--s-4);
  /* 卡面视觉与「隐藏商品解锁弹窗」(.unlock-dialog) 拉齐: 纯白 elevated 底 + 柔和悬浮投影, 无硬金边 */
  background: var(--c-bg-elevated);
  border-radius: var(--r-2xl);
  box-shadow:
    0 44px 110px rgba(31, 26, 15, 0.30),
    0 10px 28px rgba(230, 169, 76, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 220ms ease;
}
.rcpt-item-popover.is-open .rcpt-item-popover__card { transform: scale(1); opacity: 1; }
.rcpt-item-popover__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--c-ink-soft, #7a746a);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.rcpt-item-popover__close:hover { color: var(--c-gold-dark, #C98A3A); }
.rcpt-item-popover__art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(128px, 38vw, 152px);       /* 正方形小图窗, 看清商品即可 */
  height: clamp(128px, 38vw, 152px);
  /* 光晕托底 · 与普通白卡图槽完全一致 (复用 tokens --glow-slot 纯青蓝) */
  background: var(--glow-slot);
}
.rcpt-item-popover__emoji { font-size: clamp(64px, 18vw, 76px); line-height: 1; }
.rcpt-item-popover__cap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.rcpt-item-popover__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(15px, 4vw, 17px);
  color: var(--ink);
  line-height: 1.24;
}
.rcpt-item-popover__amt {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(13px, 3.4vw, 15px);
  color: var(--c-gold-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
@media (prefers-reduced-motion: reduce) {
  .rcpt-item-popover__backdrop,
  .rcpt-item-popover__card { transition: none; }
}

/* 金额计数动画 (打字机爽感) · tabular-nums 防抖 + 收尾弹一下 */
.rcpt__count {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  animation: rcpt-count-pop 420ms var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) 1450ms both;
}
@keyframes rcpt-count-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* dialog 操作按钮 · 固定票据底部, 永远可见 · 按钮等宽拉齐 · 分享突出 */
.receipt-dialog .dialog-actions {
  position: relative;             /* 承载底部撕纸齿孔 ::after 与顶部渐隐 ::before */
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0 20px;                 /* 与票据纸对齐(机头包住 20px) */
  padding: var(--s-4) var(--s-5) var(--s-5);
  background: var(--paper);
  box-shadow: 0 -12px 24px rgba(31, 26, 15, 0.14);  /* 上方内容可滚动 · alpha 从 6% 提到 14% 让暗示肉眼可辨 */
}
/* 顶部渐隐白色遮罩 · 覆盖 .receipt-body 最下 48px, 与吸底按钮之间形成 fade-out 提示还有滚动内容
   ::after 在 bottom:-5px 齿孔; ::before 在 top:-48px 渐变; 两者方位相反不冲突 */
.receipt-dialog .dialog-actions::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -48px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255, 247, 230, 0), var(--paper));
  pointer-events: none;
  z-index: 1;
}
.receipt-dialog .dialog-actions button {
  flex: 1 1 0;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 200ms var(--easing-out), box-shadow 200ms ease, background 200ms ease;
}
/* 次要: 重开本轮 / 关闭 · 白底黑字 + 细墨边 · 无特效 */
.receipt-dialog .dialog-actions button:not(#shareReceipt) {
  background: var(--paper-elevated);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(31, 26, 15, 0.16);
}
/* 主要: 分享战绩 · 金渐变 + 发光 + 微光扫过, 吸引点击 */
.receipt-dialog #shareReceipt {
  position: relative;
  overflow: hidden;
  color: var(--c-ink-deep);
  background: var(--sand-gold);
}
.receipt-dialog #shareReceipt:hover {
  background: var(--sand-gold-hi);
  transform: translateY(-2px);
}
.receipt-dialog #shareReceipt:active { transform: translateY(0) scale(0.98); }
.receipt-dialog #shareReceipt::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 32%, rgba(255, 255, 255, 0.55) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: share-shimmer 3s ease-in-out infinite;
}
@keyframes share-shimmer {
  0%, 55% { transform: translateX(-120%); }
  100%    { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  .receipt-dialog #shareReceipt::after { animation: none; display: none; }
}

/* ===== css/receipt-v2.css ===== */
/* RECEIPT v2 · 满版美术底图 + 绝对定位槽位(1152×1536 = 3:4 坐标 → 百分比)。
   槽位坐标由 js/receipt-layout.js 注入 left/top/width/height。
   容器宽度不在此定义, 由上下文决定(preview 固定 360px / 局内 min(92vw,400px) 居中)。
   字号为 360px 基准精调死值, 三端统一手机宽展示 → 1:1 保真, 不做流式放大。
   v3 新底图: 3:4 竖版, 左栏浅纸(墨色文字), 右栏黑底(badge 金边条+QR), 骑缝金章。 */

/* 票据容器: aspect-ratio 3:4, 底图 1152×1536 等比铺满 */
.receipt {
  position: relative;
  aspect-ratio: 3 / 4;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
  overflow: hidden;
}

/* ═══ 坐标对齐布局: 槽位绝对定位, 由 receipt-layout.js 注入 left/top/width/height ═══
   v3 底图: 7 张成功主题左栏全是浅纸(米白/米黄), 右栏黑底; 文字色不随换色变。 */
.rcpt2 {
  --ink-on-ticket: #2b2016;               /* 左栏主字色(对齐 mockup --ink) */
  --ink-soft-on-ticket: #6d5a35;          /* 左栏次级(对齐 mockup --ink-soft) */
  --seal-on-ticket: #F2B33D;              /* 骑缝章纯金(砂金亮金, 与主色板 --sand-gold 同) */
  position: absolute; inset: 0;
  color: var(--ink-on-ticket);
}
.rcpt2__slot { position: absolute; }

/* ── ① 立绘/emote —— 立绘 mask 融入(双向渐隐), 不再硬切贴框 ── */
.rcpt2__portrait-wrap { position: relative; width: 100%; height: 100%; overflow: visible; }
.rcpt2__char-img.is-portrait {
  position: absolute; left: 50%; top: 50%;
  /* portraitScale>1 的主题 (blue) 放大立绘补全身展示; 其余主题 1 → 原尺寸不变 */
  width: calc(93% * var(--portrait-scale, 1));   /* 左右各留 ~3.5% 呼吸 (scale=1 基准) */
  height: calc(96% * var(--portrait-scale, 1));  /* 上下各留 ~2% 呼吸 (scale=1 基准) */
  transform: translate(-50%, -50%);
  object-fit: cover; object-position: var(--portrait-focus-x, 50%) var(--portrait-focus-y, 36%);
  filter: saturate(1.04) contrast(1.02) drop-shadow(0 8px 18px rgba(60,38,12,.22));
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 6%, #000 93%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 6%, #000 93%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
}
.rcpt2__char-img.is-emote {
  position: absolute; left: 50%; top: 50%;
  width: 80%; height: 80%;                /* emote 小一些, 浅纸底不喧宾夺主 */
  transform: translate(-50%, -50%);
  object-fit: contain; object-position: center;
  filter: drop-shadow(0 6px 14px rgba(184, 123, 38, .25));
}

/* ── ⑧ 立绘画师署名胶囊 —— 作为 PLAYER SIGN 的子元素，顶边贴包框底边。 ── */
.rcpt2__artist-chip {
  position: absolute;
  display: inline-flex; align-items: center;
  /* .rcpt2__seal 的底边在签名容器高度的 88%；共线但不通过重叠掩盖框线。 */
  left: 50%; top: 88%;
  transform: translateX(-50%);
  font-family: var(--font-mono); font-weight: 700;
  font-size: 6px; line-height: 1; letter-spacing: .1em; white-space: nowrap;
  text-transform: uppercase;
  color: var(--c-ink);                            /* 暖墨黑字(同 LIMITED) */
  padding: 2px 8px; border-radius: 999px;         /* 胶囊 */
  background: linear-gradient(135deg, var(--sand-gold-hi) 0%, var(--sand-gold) 100%);  /* 金底(同 LIMITED) */
  box-shadow: 0 1px 2px rgba(0,0,0,.16);
  z-index: 1;
  pointer-events: none;
}

/* ── ② 合并进度条 —— 右段桃橙→金(对齐游戏内 converge) ── */
.rcpt2__progress { padding: 1px 3px; }
.rcpt2__progress .rcpt__converge-heads { gap: 6px; margin-bottom: 3px; }
.rcpt2__progress .rcpt__converge-head--right { padding-left: 6px; }
.rcpt2__progress .rcpt__converge-label {
  font-size: 6.5px; white-space: nowrap; color: var(--ink-soft-on-ticket);
  /* B3 字体统一: Times serif → --font-body, 与游戏内 sans 系统一致 */
  font-family: var(--font-body); letter-spacing: .06em; font-weight: 700;
  font-variant-numeric: tabular-nums; opacity: .92;
}
.rcpt2__progress .rcpt__converge-value {
  font-size: 6.8px; font-weight: 800; white-space: nowrap;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.rcpt2__progress .rcpt__converge-head--left .rcpt__converge-value { color: #B26F12; }
.rcpt2__progress .rcpt__converge-head--right .rcpt__converge-value { color: #B26F12; }
/* 轨道: 左=亮白金→金(--grad-amt), 右=亮蓝→金(--grad-egg), 与局内 focus-converge 同款 */
.rcpt2__progress .rcpt__converge-track { height: 7px; }
.rcpt2__progress .rcpt__converge-fill--left {
  background: var(--grad-amt);
}
.rcpt2__progress .rcpt__converge-fill--right {
  background: var(--grad-egg);
}
/* RECEIPT 内进度条不按胜负变色, 两侧统一金色。 */
.rcpt2__progress .rcpt__converge-mid { width: 8px; height: 8px; margin: -4px 0 0 -4px; }

/* ── ③ items 5 行明细 ── */
/* B2-4: ITEM/AMOUNT 表头已删除 (用户反馈: 5.6px 太小看不清, 明细行超边界时此装饰行是累赘) */
.rcpt2__items {
  overflow-y: auto; overflow-x: hidden;
  padding: 1px 5px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(184,123,38,.45) transparent;
}
.rcpt2__items::-webkit-scrollbar { width: 2px; }
.rcpt2__items::-webkit-scrollbar-thumb { background: rgba(184,123,38,.45); border-radius: 2px; }
.rcpt2__items .rcpt__row {
  font-size: 6.5px; padding: 0; gap: 2px;
  line-height: 1.25;
  align-items: center;
  min-height: 10px;
}
/* 超出行提示 "… +N": 居中弱化, 与 Canvas 分享图一致 */
.rcpt2__items .rcpt__row--more {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 6.2px; letter-spacing: 0.1em; line-height: 1;
  color: var(--ink-soft-on-ticket); opacity: 0.85;
}
.rcpt2__items .rcpt__rowname {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  overflow-wrap: normal; word-break: keep-all; line-height: 1.25;
  /* C2 (2026-09 拍板): EN 收据商品名走 Archivo Black 超黑 (单字重 400, 原生即粗黑);
     商品名纯拉丁, Archivo 子集 (含 a-z + ') 全覆盖。 */
  font-family: 'Archivo Black', var(--font-body); font-weight: 400;
  font-synthesis: none;
}
/* C2 CJK 回落: Archivo 无 CJK 字形, ZH/JA 商品名回 Noto Sans SC/JP 600 (细腻不糊) */
:root[lang="zh-CN"] .rcpt2__items .rcpt__rowname,
:root[lang="ja"] .rcpt2__items .rcpt__rowname {
  font-family: var(--font-body); font-weight: 600;
  font-synthesis: none;
}
.rcpt2__items .rcpt__rowname em { font-size: 5.5px; font-style: normal; opacity: 0.6; }
.rcpt2__items .rcpt__rowamt {
  font-size: 6.4px; color: var(--ink-on-ticket); font-variant-numeric: tabular-nums; line-height: 1.2;
  font-family: var(--font-mono); font-weight: 800;
}

/* ── ④ totals 同构双行 —— spent+earned 合并, 左标签右数字 baseline 对齐 ──
   数字右端死线 ≤66.5% (底图金印章实心 x68.5% 起) */
.rcpt2__totals { display: flex; flex-direction: column; }
.rcpt2__t-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 0 3px; height: 13px;
}
.rcpt2__t-row + .rcpt2__t-row { margin-top: 3px; }
.rcpt2__t-label {
  color: var(--ink-soft-on-ticket); white-space: nowrap;
  font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.14em; font-weight: 800;
  opacity: 1;   /* 两行标签同构: 统一褐灰(#6d5a35), earned 不再用深蓝跳戏 */
}
.rcpt2__t-row--spent {
  border-top: 1px solid rgba(43,32,22,.85); padding-top: 3px; height: auto; min-height: 10px;
}
/* B2-5 字体统一: 数字一律走 mono (tabular-nums), Arial Black 只留票面大标题
   totals 双行同构: 两行标签统一票据褐灰, 两行数字统一票据金渐变(spent 略沉稳/earned 略亮) */
.rcpt2__t-row--spent b {
  font-family: var(--font-mono); font-weight: 800;
  font-size: 10px; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  color: #B26F12;   /* 棕金(对齐消费目标金额色), 清爽无渐变 */
}
.rcpt2__t-row--earned .rcpt2__t-label { color: var(--ink-soft-on-ticket); }
.rcpt2__t-row--earned b {
  font-family: var(--font-mono); font-weight: 800;   /* B2-5: display→mono, 与 spent 数字同族 */
  font-size: 11px; letter-spacing: -0.03em; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #B26F12;   /* 棕金(对齐消费目标金额色), 清爽无阴影 */
}

/* ── ⑤ badge —— icon 进异形框, 名字进金边名称条 (不再用 badge-frame.png) ── */
.rcpt2__badge-icon { overflow: visible; }
.rcpt2__badge-char {
  position: absolute; left: 50%; top: 50%;
  width: 92%; height: 88%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.3));
}
.rcpt2__badge-placeholder {
  position: absolute; left: 50%; top: 50%;
  /* 2026-09 修爆框: 82% 椭圆在 144×134 异形框内四角出血 ("TO BE COLLECTED" 左右戳出框外)
     → 74% + 字距收紧, 椭圆完整落进框内 */
  width: 74%; aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(-9deg);
  border: 1.5px solid rgba(242,198,101,.92);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #f7dc93;
  /* R6: 简化 —— 去掉杂乱径向渐变/发光/多层阴影, 只留干净浅色底 */
  background: rgba(251,243,221,.9);
  box-shadow: none;
  opacity: .9;
}
.rcpt2__badge-placeholder::before {
  content: "";
  position: absolute; inset: 8%;
  border: 1px dashed rgba(247,220,147,.55);
  border-radius: 50%;
}
.rcpt2__badge-placeholder::after { content: none; }  /* R6: 删第二层虚线环 */
.rcpt2__badge-placeholder-star {
  font-size: 13px; line-height: 1; margin-bottom: 2px;
  color: #1a1a1a; text-shadow: none;                   /* R6: 星标也改黑, 去发光 */
}
.rcpt2__badge-placeholder-text {
  font-family: var(--font-mono); font-weight: 900;
  /* 2026-09 修爆框: 6.5px "TO BE COLLECTED" 两行在 74% 椭圆内仍偏挤, 降 5.8px + 收字距 */
  font-size: 5.8px; line-height: 1.15; letter-spacing: .03em;
  text-align: center; color: #1a1a1a;                          /* R6: 纯黑, 去掉一切描边/发光 */
  -webkit-text-stroke: 0;                                      /* R6: 去除白色描边 */
  text-shadow: none;                                           /* R6: 去除白色发光 */
}
/* R6: 占位印章统一为浅色干净底 + 纯黑字, 不再按主题换色/叠加渐变 */
.rcpt2__badge-name {
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;                        /* R5: 防长名贴边/出血 */
  box-sizing: border-box;
}
.rcpt2__badge-title {
  color: #f3e6c2;                       /* 名称条是金边黑底 => 米白金字 */
  /* Badge 下方称号与结算 quote 同源：使用 Forum / CJK 衬线常规字重。 */
  font-family: var(--font-quote); font-weight: 400;
  font-size: 6.5px; line-height: 1.25;  /* R4: 7→6.5px 防长名溢出 */
  letter-spacing: 0.02em;
  white-space: normal;                  /* R3: nowrap→normal 允许折行 */
  overflow: hidden;
  max-width: 100%;
  text-align: center;                   /* R4: 统一居中排布, 折行也居中 */
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
  pointer-events: none;
  /* 2026-09 修 #2: word-break/overflow-wrap:break-word 会把 "Slumbernana" 拆成
     "Slumbernan a", "Shareholder" 拆成 "Shareh older" —— 单词内断行可读性崩坏。
     改 overflow-wrap:anywhere (只在单词本身超过一行宽时才断词, 常规按词折行)。 */
  word-break: normal;
  overflow-wrap: anywhere;
}
.rcpt2__badge-title--empty {
  /* 2026-09 修爆框: "#N LOCKED" 曾走 5.2px 死值仍贴名称条边;
     fitBadgeNames 起始字号 6.5px 对它太大, 这里直接压到 5px + 收字距, 不再触框 */
  font-family: var(--font-mono); font-size: 5px; letter-spacing: .04em;
  white-space: nowrap;
  color: rgba(245,208,108,.88); opacity: .9;
}

/* ── ⑥ QR 码 —— 浅米底板四边贴金框内缘, 深码可扫 ── */
.rcpt2__qr {
  display: flex; align-items: center; justify-content: center;
  background: rgba(251,243,221,.98);
  padding: 1px;                     /* 贴框后只留 1px 呼吸, 不再做双层金边/圆角 */
  overflow: visible;
}
.rcpt2__qr-img {
  width: 100%; height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* ── ⑦ 骑缝金章玩家签名 —— 跨左栏右缘+中缝, normal 合成保纯金 ── */
.rcpt2__sign-btn {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-8deg);
  border: 0; background: transparent; cursor: pointer;
  mix-blend-mode: normal; opacity: .95;
  z-index: 5;
  overflow: visible;
}
.rcpt2__seal {
  width: 88%; height: 78%;
  border: 1.6px solid var(--seal-on-ticket); border-radius: 999px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--seal-on-ticket);
  background:
    radial-gradient(circle at 30% 35%, rgba(242,179,61,.05), transparent 60%),
    repeating-linear-gradient(-18deg, rgba(242,179,61,.035) 0 2px, transparent 2px 6px);
  box-shadow: inset 0 0 0 1px rgba(242,179,61,.5);
}
.rcpt2__seal::before {
  content: "PLAYER SIGN";
  position: absolute; top: 9%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-weight: 800;
  font-size: 3.8px; letter-spacing: .16em; white-space: nowrap;
}
.rcpt2__seal::after {
  content: "MAX OUT · 2026";
  position: absolute; bottom: 9%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-weight: 800;
  font-size: 3.8px; letter-spacing: .12em; white-space: nowrap;
}
.rcpt2__seal-name {
  max-width: 82%; white-space: nowrap;
  /* 2026-09 修 #6: overflow visible → hidden。离屏 clone 渲染时字体可能未就绪,
     fitSignature 量到的 scrollWidth 偏小 → 文字实际渲染时溢出章缘。hidden 保底,
     即使自适应失准, 文字也始终被章缘裁掉, 不会"甩"到票面外。 */
  overflow: hidden;
  /* B3 字体统一: Times serif → --font-display, 与票面"RECEIPT"大标题/游戏内 MAX OUT 同族
     (原注释"与票面衬线统一"已过时——票面大标题在底图里, 不是衬线字) */
  font-family: var(--font-display); font-weight: 900;
  font-size: 13px; line-height: 1;
  letter-spacing: -0.02em; text-transform: uppercase;
  transform: translateY(1px);
}

/* ── ⑧ 票号竖排装饰 —— 左侧黑包边带, 自下而上阅读, 纯装饰 ── */
.rcpt2__serial-deco {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-90deg);
  transform-origin: center center;
  white-space: nowrap;
  color: rgba(255,255,255,.92);
  font-family: var(--font-mono); font-weight: 800;
  font-size: 5.4px; line-height: 1;
  letter-spacing: 0.28em;
  text-shadow: 0 1px 3px rgba(0,0,0,.85);
  pointer-events: none;
}
.rcpt2__serial-deco .rcpt2__serial-dot { opacity: .5; padding: 0 .35em; }

/* 槽位调试边框(showZones) */
.rcpt2--zones .rcpt2__slot {
  outline: 1.5px dashed rgba(255, 40, 40, .6);
  outline-offset: -2px;
}

/* ════════════ 局内 dialog 外壳整合(保留打印机机头) ════════════
   目标: 机头 + 满版票据 + 底部按钮三段, 三端统一手机宽居中, 全票据不滚动。
   dialog 宽度 = 手机宽上限, 且按可用高度等比收缩(矮屏/横屏也塞得下, 机头刚好盖住票据)。
   v3: 高度反推公式 9:16→3:4。 */
:where(:root[data-layout="mobile"], :root[data-layout="tablet"]) dialog.receipt-dialog {
  /* 宽度: 手机宽上限 400px, 并按可用高度反推(3:4)避免高屏溢出;
     下限 330px —— 字号是 360px 基准死值, 低于此会挤压重叠, 宁可让 body 滚动兜底。
     210px ≈ 机头(~90) + 按钮(~60) + 上下留白。 */
  width: min(92vw, 400px, max(330px, calc((100dvh - 210px) * 3 / 4)));
  max-width: 400px;
  height: auto;
  max-height: 96dvh;
  margin: auto;
  inset: 0;
  overflow: visible;
}

:root[data-layout="desktop"] dialog.receipt-dialog {
  --rcpt-desktop-scale: 2;
  --rcpt-desktop-extra-height: calc(533.333px * (var(--rcpt-desktop-scale) - 1));
  --rcpt-desktop-width: 840px;
  width: min(92vw, var(--rcpt-desktop-width, 840px));
  max-width: var(--rcpt-desktop-width, 840px);
  height: auto;
  max-height: 96dvh;
  margin: auto;
  inset: 0;
  overflow: visible;
}
dialog.receipt-dialog form,
:where(:root[data-layout="mobile"]) dialog.receipt-dialog form {
  height: auto;
  max-height: 96dvh;
}
:root[data-layout="desktop"] dialog.receipt-dialog form { max-height: 96dvh; }
/* body: 奶油纸底/内边距中性化, 满版票据自带底图。flex:0 1 auto → 正常屏 = 票据高(无缝贴按钮),
   短屏/横屏放不下时 body 收缩并滚动(票据不再被压小到字号崩塌)。 */
dialog.receipt-dialog .receipt-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: transparent;
  box-shadow: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;   /* 不拉伸: 票据保持 3:4, 短屏放不下时溢出→滚动(而非被压扁) */
}
dialog.receipt-dialog .receipt-body .receipt {
  width: 100%;
  flex: 0 0 auto;
}
:root[data-layout="desktop"] dialog.receipt-dialog .receipt-body {
  overflow: visible;
}
:root[data-layout="desktop"] dialog.receipt-dialog .receipt-body .receipt {
  width: 400px;
  transform: scale(var(--rcpt-desktop-scale));
  transform-origin: top center;
  margin-bottom: var(--rcpt-desktop-extra-height); /* transform 不参与布局, 补足 400×4/3 放大后的滚动高度 */
}
/* C1: 桌面 scale 改由 JS 动态算 (receipt.js fitReceiptDesktopScale),
   16 个 max-height 断点全部退役。票据按可用高度等比 1~2× 缩放。 */

/* 按钮条中性化: 去奶油底 + 去 ::before 奶油渐隐(它会盖住票据底部 serial/条码) + 去 ::after 齿孔,
   满版票据自带撕边/条码, 按钮浮在票据下方(dialog backdrop 已模糊)。 */
dialog.receipt-dialog .dialog-actions {
  background: transparent;
  box-shadow: none;
  margin: 0;
  padding: 12px 16px 4px;
  /* 2026-09 修 #5: PC R3 通关后 4 按钮行(RETRY/MAX OUT/RESTYLE!/SHARE)在 840px dialog 内挤不下,
     RESTYLE! 被 text-overflow 截成 "RESTY..."。允许按钮行按内容自然伸展 + 必要时 wrap。 */
  flex-wrap: wrap;
  justify-content: center;
}
dialog.receipt-dialog .dialog-actions::before,
dialog.receipt-dialog .dialog-actions::after {
  display: none;
}

/* ── 按钮轻量化: 默认去弥散阴影/金渐变/扫光, 融入复古票据;
   仅 MAX OUT 与分享 CTA 在下方保留有明确语义的金色动效。 ── */
dialog.receipt-dialog .dialog-actions button {
  box-shadow: none;
  border-radius: var(--r-full);
  transition: background 160ms ease, transform 160ms ease;
  white-space: nowrap;
  /* EN 长文案兜底: 不允许按钮溢出容器, 文字超出则省略 */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
dialog.receipt-dialog #shareReceipt {
  background: var(--sand-gold);
  box-shadow: inset 0 0 0 1px rgba(90, 60, 20, .35);
}
dialog.receipt-dialog #shareReceipt::before { display: none; }
/* “炫耀一下”沿用隐藏商品解锁胶囊的白金扫光：窄光带穿过，而非整块泛白。 */
dialog.receipt-dialog #shareReceipt::after {
  content: '';
  display: block;
  position: absolute;
  inset: -8px auto -8px -68px;
  width: 58px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 244, 184, .22) 22%, rgba(255,255,255,.94) 50%, rgba(255, 240, 159, .30) 76%, transparent 100%);
  box-shadow: 0 0 13px rgba(255, 241, 170, .72);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: unlock-pill-sparkle 2300ms cubic-bezier(.2,.75,.25,1) 700ms infinite;
}
dialog.receipt-dialog #shareReceipt:hover {
  background: var(--sand-gold-hi);
  box-shadow: inset 0 0 0 1px rgba(90, 60, 20, .35);
  transform: none;
}
dialog.receipt-dialog .dialog-actions button:not(#shareReceipt) {
  background: var(--ink);
  color: var(--ink-on-dark);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3);
}
/* Receipt 操作区统一两列：四个操作必为 2×2，三按钮为 2+1。
   不再依赖内容宽度碰运气换行，中文/英文/日文均不会挤成省略号。 */
dialog.receipt-dialog .dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
dialog.receipt-dialog .dialog-actions button,
dialog.receipt-dialog .dialog-actions button#receiptThemeNext,
dialog.receipt-dialog .dialog-actions button#receiptRetryRound,
dialog.receipt-dialog .dialog-actions button#receiptRestart[value="endless"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding-inline: 8px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
}

dialog.receipt-dialog .dialog-actions button#receiptThemeNext {
  background: rgba(255,255,255,.96);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(184,123,38,.35);
}
/* 2026-09 修 #5: PC/tablet R3 通关后 4 按钮行(RETRY/MAX OUT/RESTYLE!/SHARE)挤不下,
   RESTYLE! 被 text-overflow 截成 "RESTY..."。仅宽屏给 RESTYLE! 保底宽不缩;
   mobile 仍走紧排版(4 按钮行 360px 预算, 用 clamp 字号兜底, 不能给死 min-width)。 */
:where(:root[data-layout="desktop"], :root[data-layout="tablet"]) dialog.receipt-dialog .dialog-actions button#receiptThemeNext {
  flex: 0 0 auto;
  padding-inline: 16px;
  min-width: 104px;
  /* 2026-09-04 视觉层级: 白底次按钮保持内容固有宽, 居中档。 */
}
/* 2026-09-04 R3 通关 4 按钮视觉层级: Retry 最小 / もう一枚！ 居中 / MAX OUT·自慢する 最大。
   - Retry(receiptRetryRound): 改 flex 0 0 auto + 字号 12px + 收紧 padding, 收缩到内容宽, 不再与自慢する等分。
   - MAX OUT(receiptRestart[endless]): 改 flex 1 1 0 + 字号回 14px(去 13px 特例), 与自慢する等分剩余空间。
   - 自慢する(shareReceipt): 保持 flex 1 1 0 不变。 */
:where(:root[data-layout="desktop"], :root[data-layout="tablet"]) dialog.receipt-dialog #receiptRetryRound {
  flex: 0 0 auto;
  min-width: 0;
  padding-inline: 14px;
  font-size: 12px;
}
:where(:root[data-layout="desktop"], :root[data-layout="tablet"]) dialog.receipt-dialog #receiptRestart[value="endless"] {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 16px;
  font-size: 14px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 三语按钮文案实测: 4 按钮行总宽预算紧张, padding/gap 收到最紧 (文案侧同样保持短文案)
   2026-09-04: 4 按钮 wrap 2×2 (手机端 "MAX OUT MODE" 太长截断) ——
   flex-basis:calc(50%-2.5px) 两两一行, RETRY/MAX OUT 上行, RESTYLE!/SHARE 下行,
   字号 12→11px 进一步保底, JA/ZH/EN 三语均完整显示。
   2026-09-05: tablet 档纳入 —— tablet dialog 同为 min(92vw,400px) 宽 (receipt-v2 外壳规则),
   单行 4 按钮 ~84px/钮放不下 "挑战 MAX OUT"/"炫耀一下", 三语均被 ellipsis 截断;
   与 mobile 同宽就该同排版, 2×2 wrap 直接复用。 */
:where(:root[data-layout="mobile"], :root[data-layout="tablet"]) dialog.receipt-dialog .dialog-actions {
  gap: 5px;
  padding-inline: 8px;
}
:where(:root[data-layout="mobile"], :root[data-layout="tablet"]) dialog.receipt-dialog .dialog-actions button {
  min-height: 44px;
  padding-inline: 6px;
  font-size: 11px;
  letter-spacing: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 2×2 wrap: 每按钮占半行, 两个一行; 允许换行保底 */
  flex: 1 1 calc(50% - 2.5px);
  white-space: normal;
  line-height: 1.2;
}
/* MAX OUT(endless) 保持等宽不额外膨胀 */
:where(:root[data-layout="mobile"], :root[data-layout="tablet"]) dialog.receipt-dialog #receiptRestart[value="endless"] {
  flex: 1 1 calc(50% - 2.5px);
  font-size: clamp(10px, 2.9vw, 11px);
}
/* EN 长文案 ("Change a Receipt Style!" 24 字符) 在 mobile 上独立缩字号, 避免 nowrap 溢出按钮 */
:where(:root[data-layout="mobile"], :root[data-layout="tablet"]) dialog.receipt-dialog #receiptThemeNext {
  font-size: clamp(10px, 2.9vw, 11px);
  letter-spacing: -0.01em;
}
/* tablet 2×2 排版下, 前面 desktop+tablet 特例给三个按钮定的 flex/min-width/padding/字号
   (特异性更高, 不会被上面通用 button 规则覆盖) 全部收回 —— 半行按钮按内容自适应宽。 */
:where(:root[data-layout="tablet"]) dialog.receipt-dialog .dialog-actions button#receiptThemeNext {
  flex: 1 1 calc(50% - 2.5px);
  min-width: 0;
  padding-inline: 6px;
}
:where(:root[data-layout="tablet"]) dialog.receipt-dialog .dialog-actions button#receiptRetryRound {
  flex: 1 1 calc(50% - 2.5px);
  font-size: 11px;
}
:where(:root[data-layout="tablet"]) dialog.receipt-dialog .dialog-actions button#receiptRestart[value="endless"] {
  flex: 1 1 calc(50% - 2.5px);
  padding-inline: 6px;
  font-size: clamp(10px, 2.9vw, 11px);
  letter-spacing: 0;
}

/* 2026-09-10 PC 矮屏 receipt 按钮区紧凑档: 700px 视口实测 4 按钮区 110px 与票据底重叠,
   反推 scale 后仍因按钮区过高压掉票据。这里把 desktop 矮屏按钮行高 44→34、上下 padding 收紧,
   按钮文字字号不动保持可读, 票据底边让出 ~30px。 */
:where(:root[data-layout="desktop"]) dialog.receipt-dialog.receipt-dialog--short .dialog-actions {
  padding: 8px 16px 2px;
  gap: 5px;
  align-items: start;
}
:where(:root[data-layout="desktop"]) dialog.receipt-dialog.receipt-dialog--short .dialog-actions button,
:where(:root[data-layout="desktop"]) dialog.receipt-dialog.receipt-dialog--short .dialog-actions button#receiptThemeNext,
:where(:root[data-layout="desktop"]) dialog.receipt-dialog.receipt-dialog--short .dialog-actions button#receiptRetryRound,
:where(:root[data-layout="desktop"]) dialog.receipt-dialog.receipt-dialog--short .dialog-actions button#receiptRestart[value="endless"] {
  min-height: 34px;
  height: 34px;
  padding-block: 2px;
  align-self: start;
}

/* ── 机头"吐票"层次: 收紧机头与票据缝 + 票据顶部承接出纸口投影 + 弱化纸缝赛博发光/LED ── */
dialog.receipt-dialog .printer {
  position: relative; z-index: 5;
  width: calc(100% + 16px);
  margin-left: -8px; margin-right: -8px;
  margin-bottom: -16px;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .32));
}
dialog.receipt-dialog .printer__slot { margin: 0; }
dialog.receipt-dialog .printer__body { background: linear-gradient(180deg, #232323 0%, #050505 100%); }
dialog.receipt-dialog .receipt-body { z-index: 1; }
dialog.receipt-dialog .receipt-body { position: relative; }
dialog.receipt-dialog .printer__slot::after { box-shadow: none; opacity: .65; }
dialog.receipt-dialog .printer__led { box-shadow: 0 0 4px var(--sand-gold); }

/* ── 结局出纸章：在机头完成“判定 → 下一步”的单一信息闭环，不新增弹窗或操作。 ── */
dialog.receipt-dialog .printer__body { gap: 10px; }
dialog.receipt-dialog .printer__brand {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
dialog.receipt-dialog .printer__led { flex: 0 0 auto; }
.receipt-result-badge {
  --result-ink: var(--sand-gold);
  --result-fill: rgba(230, 169, 76, .13);
  --result-shadow: rgba(230, 169, 76, .36);
  position: relative;
  flex: 0 1 120px;                /* B2-3: 164→120 缩小 */
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 3px 8px 3px;           /* B2-3: 5/11→3/8 收紧 */
  border: 1.5px solid var(--result-ink);
  border-radius: 4px;
  color: var(--result-ink);
  background: var(--result-fill);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 2px 7px var(--result-shadow);
  font-family: var(--font-mono);
  line-height: 1;
  text-align: center;
  transform: rotate(-2deg);
  transform-origin: center;
  overflow: hidden;
}
.receipt-result-badge::before,
.receipt-result-badge::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid color-mix(in srgb, var(--result-ink) 72%, transparent);
  border-radius: 2px;
  pointer-events: none;
}
.receipt-result-badge::after {
  inset: auto 7px 4px;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--result-ink), transparent);
  opacity: .48;
}
.receipt-result-badge__label {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 13px;                /* B2-3: 17→13 缩小 */
  font-weight: 900;
  letter-spacing: .05em;
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
  white-space: nowrap;
}
.receipt-result-badge[data-status="failure"],
.receipt-result-badge[data-status="maxout-failure"] {
  --result-ink: #ef716d;
  --result-fill: rgba(135, 23, 27, .22);
  --result-shadow: rgba(230, 57, 70, .28);
  /* B3 方向统一: rotate(2deg) → rotate(-2deg), 与骑缝章 PLAYER SIGN (rotate -8deg) 同向左下→右上
     颜色已能区分胜败, 斜率不应再当差异信号 */
  transform: rotate(-2deg);
}
.receipt-result-badge[data-status="maxout-clear"] {
  --result-ink: #f4cf72;
  --result-fill: rgba(240, 200, 120, .2);
  --result-shadow: rgba(240, 200, 120, .38);
}
.receipt-result-badge.is-stamped {
  animation: receipt-result-stamp 420ms var(--ease-doodle) 600ms both;
}
@keyframes receipt-result-stamp {
  0% { opacity: 0; transform: rotate(-8deg) scale(1.45); filter: blur(1px); }
  65% { opacity: 1; transform: rotate(-1deg) scale(.94); filter: none; }
  100% { opacity: 1; transform: rotate(-2deg) scale(1); filter: none; }
}
.receipt-result-badge[data-status="failure"].is-stamped,
.receipt-result-badge[data-status="maxout-failure"].is-stamped {
  animation-name: receipt-result-stamp-failure;
}
/* B3 方向统一: 失败盖章动画斜率镜像成功, 起点 +8deg→-8deg, 终点 +2deg→-2deg,
   与骑缝章/成功徽章保持同向左下→右上 */
@keyframes receipt-result-stamp-failure {
  0% { opacity: 0; transform: rotate(-8deg) scale(1.45); filter: blur(1px); }
  65% { opacity: 1; transform: rotate(-1deg) scale(.94); filter: none; }
  100% { opacity: 1; transform: rotate(-2deg) scale(1); filter: none; }
}

:where(:root[data-layout="mobile"]) .receipt-result-badge {
  flex-basis: 96px;               /* B2-3: 130→96 */
  padding: 3px 6px 3px;
}
:where(:root[data-layout="mobile"]) .receipt-result-badge__label { font-size: 11px; letter-spacing: .03em; }
:where(:root[data-layout="mobile"]) dialog.receipt-dialog .printer__body { gap: 6px; padding-inline: 16px; }
/* 2026-09: 机头 brand "#MaxOutAventurinesCard" 在 360px 宽 + FAILED 章 + LED 下省略成 #MaxOutAventu…
   字号 14→clamp + 压缩字距, 多数机型完整显示; 极端窄屏仍兜底 ellipsis (样式已带) */
:where(:root[data-layout="mobile"]) dialog.receipt-dialog .printer__brand {
  font-size: clamp(11px, 3.6vw, 14px);
  letter-spacing: -0.01em;
}

/* “重开本轮”是失败后的唯一重试 CTA：黑底、纯白字；不影响重新开始/挑战无尽/分享。
   2026-09-04: 克制的呼吸浮动从 RETRY 挪到 MAX OUT(value=endless) —— RETRY 静止, MAX OUT 吸点击。 */
dialog.receipt-dialog .dialog-actions button[value="restart"] {
  background: #080808;
  color: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24), 0 3px 10px rgba(0, 0, 0, .22);
}
dialog.receipt-dialog .dialog-actions button[value="restart"]:hover {
  background: #1a1a1a;
  transform: scale(1.025);
}
dialog.receipt-dialog .dialog-actions button[value="restart"]:active {
  transform: scale(.97);
}
/* MAX OUT(R3 通关 receiptRestart value=endless): 亮金本体 + 轻跳呼吸，成为通关后的主推 CTA。 */
dialog.receipt-dialog .dialog-actions button#receiptRestart[value="endless"] {
  color: #291900;
  background: var(--sand-gold);
  box-shadow:
    inset 0 0 0 1px rgba(108, 62, 0, .38),
    0 4px 14px rgba(242, 179, 61, .38);
  text-shadow: none;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  animation: receipt-maxout-gold-pulse 1600ms cubic-bezier(.37,0,.2,1) 500ms infinite;
}
dialog.receipt-dialog .dialog-actions button#receiptRestart[value="endless"]:hover {
  animation: none;
  background: var(--sand-gold-hi);
  box-shadow:
    inset 0 0 0 1px rgba(108, 62, 0, .44),
    0 7px 20px rgba(242, 179, 61, .5);
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.04) saturate(1.06);
}
dialog.receipt-dialog .dialog-actions button#receiptRestart[value="endless"]:active {
  animation: none;
  transform: translateY(0) scale(.97);
}
@keyframes receipt-maxout-gold-pulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: inset 0 0 0 1px rgba(108, 62, 0, .38), 0 3px 11px rgba(242, 179, 61, .3);
    filter: brightness(1) saturate(1);
  }
  48% {
    transform: translateY(-2px) scale(1.03);
    box-shadow: inset 0 0 0 1px rgba(108, 62, 0, .44), 0 7px 22px rgba(242, 179, 61, .58);
    filter: brightness(1.09) saturate(1.08);
  }
  66% {
    transform: translateY(-1px) scale(1.018);
    box-shadow: inset 0 0 0 1px rgba(108, 62, 0, .41), 0 5px 16px rgba(242, 179, 61, .44);
    filter: brightness(1.04) saturate(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .receipt-result-badge.is-stamped,
  dialog.receipt-dialog .dialog-actions button[value="restart"],
  dialog.receipt-dialog .dialog-actions button#receiptRestart[value="endless"] { animation: none; }
  dialog.receipt-dialog #shareReceipt::after { display: none; animation: none; }
}

/* ===== css/challenge.css ===== */
/* 挑战模式组件层。
   包含: Hero 名字输入 + 焦点层 + 骰子按钮 + 隐藏解锁 Modal + 轮次结算 Modal。
   视觉严格取 tokens.css 变量, 不引入新色板。 */

/* ─────────────  可访问性  ───────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero 名字输入 / hint / 无尽入口的样式全部在 styles.css 的 .hero 作用域内定义
   (更高优先级, 完全覆盖); 此处不再重复。 */

/* ─────────────  challenge-root · 目标与底栏固定，商品区不足时局部轻量滚动  ───────────── */
.challenge-root {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: var(--s-3) 0 calc(var(--s-2) + env(safe-area-inset-bottom, 0px));
}
/* 移动端 · 只使用父级 gap 分层 */

:where(:root[data-layout="mobile"]) {

  .challenge-root {
    gap: 6px;   /* 顶部各区(财富/ticker/倒计时)间距收紧 10→6, 省出的竖向空间归商品区(shop flex:1) */
    /* 底 padding s-3→s-2: 压缩底栏占高, 增大商品区一屏可见范围 (2026-09-03) */
    padding: var(--s-2) 0 calc(var(--s-2) + env(safe-area-inset-bottom, 0px));
  }

}

/* PC · 区域留白统一由父级 gap 控制,把重复间距还给商品卡 (MD §P1-2) */

:where(:root[data-layout="tablet"], :root[data-layout="desktop"]) {

  .challenge-root {
    gap: var(--s-4);
    padding: var(--s-4) 0 calc(var(--s-4) + env(safe-area-inset-bottom, 0px));
  }

}

/* 保证 hidden 属性能真的隐藏(自定义 display 会覆盖 UA display:none) */
[hidden] { display: none !important; }

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

/* ─────────────  骰子按钮 · 底部操作栏主角 (金色 CTA 语言) ───────────── */
.dice-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-full);
  color: var(--c-ink-deep);
  background: var(--sand-gold);
  /* 按钮统一 display (2026-09): 与主操作按钮同族 */
  font-family: var(--font-display);
  font-weight: 700;
  font-synthesis: none;
  font-size: var(--fs-md);
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms var(--easing-out), filter 160ms ease;
}
.dice-button:hover:not(:disabled) {
  background: var(--sand-gold-hi);
  /* hover 抖动删除 · 骰子只在 is-rolling 时 tumble */
}
.dice-button:active:not(:disabled) { transform: scale(0.96); animation: none; }
.dice-button:disabled {
  filter: grayscale(0.5);
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(31, 26, 15, 0.06);
  color: var(--c-ink-soft);
  box-shadow: none;
  animation: none;
}
.dice-icon {
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 500ms var(--easing-bounce);
}
.dice-icon img {
  width: 1em;
  height: 1em;
  display: block;
}
/* 默认态 label 为空(仅 🎲 emoji): 折叠 flex 间隙, 避免 🎲 与剩余次数间多余空隙。
   状态文字(最后一次!/次数用尽)非空时正常显示。 */
.dice-label:empty { display: none; }
.dice-button.is-rolling .dice-icon {
  animation: dice-tumble 520ms ease-out;
}
@keyframes dice-tumble {
  0%   { transform: rotate(0)      scale(1);    }
  30%  { transform: rotate(200deg) scale(1.24); }
  70%  { transform: rotate(340deg) scale(0.94); }
  100% { transform: rotate(360deg) scale(1);    }
}
.dice-cooldown {
  min-width: 32px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: rgba(31, 26, 15, 0.10);
  color: var(--c-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
}
/* 隐藏身份只显示 LIMITED 角标; 卡片底色统一由金额分层决定, 避免 Limited 与贵价包装打架。 */

/* 隐藏卡 emoji · drop-shadow 差异化 */
.item-card[data-hidden='true'] .item-emoji {
  filter: drop-shadow(0 0 24px rgba(230, 169, 76, 0.42));
}
.item-card[data-hidden='true']:hover .item-emoji {
  transform: rotate(4deg) scale(1.1);
  animation: none;
}

/* ─────────────  购买操作 · 「+」金钮 → 购买后展开「− n +」步进器 (2026-09-03 恢复旧版折叠态) + 数量角标
   布局见 styles.css .item-foot/.item-actions。PC/iPad: 默认 count=0 只显「+」金钮, 购买后展开为 −/count/+;
   手机端整组隐藏(点整卡购买)、数量由右下角 qty-badge 角标表达。
   达上限(5)整卡置灰(interactions.css data-item-capped)。 ───────────── */
.qty-btn {
  width: 28px;
  height: 28px;   /* 胶囊 padding 2px×2 → 总高 32, 与 count=0 金钮(32)对齐, 消除展开时垂直跳动 */
  border: 0;
  border-radius: var(--r-full);
  background: rgba(31, 26, 15, 0.05);
  color: var(--c-ink-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 120ms var(--easing-out);
}
.qty-btn:hover:not(:disabled) {
  background: rgba(232, 204, 122, 0.30);
  color: var(--c-gold-dark);
}
.qty-btn:active:not(:disabled) { transform: scale(0.92); }
.qty-btn:disabled { opacity: 0.3; cursor: not-allowed; }
/* 步进器中央件数 (PC/iPad; 手机端随整组步进器隐藏, 件数走 qty-badge) */
.qty-count {
  min-width: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--c-ink-soft);
}
.qty-count.has-value { color: var(--c-gold-dark); }

/* 数量角标 · 浅金底, 悬浮在卡片右下角边框上(超出卡片一些, 像 hover 角标)。
   默认隐藏(空文本), 买到>0 显示件数。负 right/bottom 让角标半压在卡片边缘外凸。 */
.qty-badge {
  position: absolute;
  right: -7px;                 /* 超出卡片右边框 */
  bottom: -7px;                /* 超出卡片下边框 */
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--sand-gold-hi) 0%, var(--sand-gold) 100%);   /* 浅金底 */
  color: var(--c-ink-deep);                         /* 墨字, 浅金底上可读 */
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  pointer-events: none;          /* 不拦截点卡购买 */
  box-shadow: 0 2px 6px rgba(31, 26, 15, 0.4);
  border: 1.5px solid var(--paper-elevated);  /* 白描边, 与卡面分离更像悬浮 */
  z-index: 6;                    /* 压过卡内一切元素 (LIMITED 角标 z-index:4), 不被遮住 */
}
.qty-badge:empty { display: none; }   /* 0 件(空文本)时隐藏 */

/* count=0 折叠态: −/count 归零, 只留「+」金主加钮; 用 max-width/opacity 折叠而非 display:none,
   配合 transition 让展开为步进器时平滑过渡 (width:auto 不可过渡, max-width 可)。
   min-width:0 + padding:0 必须: 前者防 card-buy 档 min-width 顶在 max-width:0 上,
   后者防浏览器默认 button padding(2px 6px) 留在 max-width 约束之外 → 折叠真正归零。 */
.qty-count,
.qty-btn[data-role="minus"] {
  max-width: 60px;
  min-width: 0;
  padding: 0;
  transition: max-width 200ms var(--easing-out), opacity 160ms ease, margin 200ms ease, padding 200ms ease;
  overflow: hidden;
  white-space: nowrap;
}
.item-card[data-count="0"] .qty-count,
.item-card[data-count="0"] .qty-btn[data-role="minus"] {
  max-width: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
/* 「+」金钮: 仅 count=0(默认) 金色; 展开为步进器后回到普通灰钮 (尺寸/字号在下方 card-buy 32px 档统一) */
.item-card[data-count="0"] .qty-btn[data-role="plus"] {
  width: 32px;
  height: 32px;              /* 与展开态 28+2*2 padding=32 对齐, 消除展开跳动 */
  background: var(--sand-gold);
  color: var(--c-ink-deep);
  font-size: 18px;
  transition: background 160ms ease, color 160ms ease;
}
.item-card[data-count="0"] .qty-btn[data-role="plus"]:hover { background: var(--sand-gold-hi); }

/* ─────────────  隐藏解锁 Modal · 礼品卡式 4 层惊喜  ─────────────
   信息层级: Unlock 手写体(情感) → 美术破框(焦点) → 名称(核心) → 台词(释义) → 单胶囊(规则)
   视觉要点: 大圆角 / 无硬描边 / 美术向上溢出 / Harshita 手写体 / 四角星错落 / 入场错峰回弹 */
.unlock-dialog {
  /* 宽度与晋升弹窗 (round-end) 拉齐 · 三端同步 */
  width: min(calc(100% - 32px), 480px);
  max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: var(--r-2xl);
  padding: 0;
  background: var(--c-bg-elevated);
  /* 柔和悬浮投影 · 无 3px 硬金边 */
  box-shadow:
    0 40px 100px rgba(31, 26, 15, 0.28),
    0 8px 24px rgba(230, 169, 76, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: visible;             /* 让美术能破框 */
  position: relative;
  animation: unlock-pop var(--dur-slow) var(--ease-doodle);
}
.unlock-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.unlock-dialog form { margin: 0; position: static; }
.unlock-dialog .dialog-close {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  z-index: 5;
  background: rgba(31, 26, 15, 0.05);
  transition: background var(--dur-fast) var(--ease-out);
}
.unlock-dialog .dialog-close:hover { background: rgba(31, 26, 15, 0.12); }

/* ═══ 美术破框舞台 · 向上溢出卡片顶 ═══ */
.unlock-art-stage {
  position: relative;
  margin: -32px auto 0;
  width: 200px;
  height: 200px;
  animation: unlock-art-drop var(--dur-hero) var(--ease-doodle) both;
}
.unlock-emoji {
  position: relative;
  z-index: var(--z-raised);
  display: grid;
  place-items: center;
  width: 200px;
  height: 200px;
  font-size: 96px;
  line-height: 1;
  /* 蓝金晕染底(去棕金滤镜): 蓝心→淡蓝→金收边 */
  background: radial-gradient(56% 56% at 50% 46%,
    rgba(126, 199, 242, 0.34) 0%,
    rgba(180, 218, 244, 0.16) 46%,
    rgba(247, 205, 110, 0.15) 72%,
    rgba(255, 255, 255, 0) 90%);
  border-radius: 20px;
  filter: drop-shadow(0 14px 28px rgba(31, 26, 15, 0.14));
}
.unlock-emoji[data-has-art='true'] { line-height: 1; }
.unlock-art {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 320ms var(--ease-out);
}
/* H_sangohara 彩蛋: 1s 后原图淡出 / Lygus 立绘淡入 (grid 同格堆叠) */
.unlock-art.is-swapping { opacity: 0; }
.unlock-art--reveal { opacity: 0; grid-area: 1 / 1; }
.unlock-art--reveal.is-in { opacity: 1; }
/* 四角星 · 静态错落 + 延迟闪烁 */
.unlock-sparkle {
  position: absolute;
  color: var(--c-gold);
  fill: currentColor;
  filter: drop-shadow(0 0 6px rgba(230, 169, 76, 0.5));
  opacity: 0;
  animation: sparkle-blink 600ms var(--ease-out) forwards;
}
.unlock-sparkle.s1 { top: 12%;  left: 6%;   animation-delay: 200ms; }
.unlock-sparkle.s2 { top: 30%;  right: 4%;  animation-delay: 380ms; }
.unlock-sparkle.s3 { bottom: 8%; left: 18%; animation-delay: 540ms; }

/* ═══ 文本主体 ═══ */
.unlock-body {
  padding: var(--s-2) var(--s-5) var(--s-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}
/* 手写体 Unlock · Harshita · 情感唤醒第一触点 */
.unlock-flourish {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 56px;
  line-height: 0.9;
  color: var(--c-gold-dark);
  letter-spacing: 0.02em;
  animation: unlock-fade-up var(--dur-base) var(--ease-out) 150ms both;
}
.unlock-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-xl);
  color: var(--c-ink);
  letter-spacing: -0.01em;
  animation: unlock-fade-up var(--dur-base) var(--ease-out) 260ms both;
}
/* 台词 · 隐藏商品弹窗副标题 → quote 衬线 (Forum / Noto Serif SC / Shippori Mincho),
   与结算/教学/商品卡副标题同源; 去掉 italic(衬线温润古典, 无需斜体), 金棕 + 16px 拉开层级 */
.unlock-quote {
  margin: 0;
  font-family: var(--font-quote);
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--c-gold-dark);
  max-width: 15em;                 /* em 单位跨字体稳定(全角 1em), 长文案自然折两行; 勿用 ch(依赖数字0宽度, 日文半角0致折4行) */
  text-wrap: balance;              /* 两行长度均衡, 避免孤字掉行 */
  animation: unlock-fade-up var(--dur-base) var(--ease-out) 380ms both;
}
/* 底部单胶囊 · 解锁反馈 · 轻量金色闪光标识 */
.unlock-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: var(--s-2) 0 0;
  padding: 8px 20px;
  border-radius: var(--r-full);
  border: 0;
  background: #f3c45d;
  color: #513009;
  font-family: var(--font-display);   /* 与隐藏商品弹窗标题同源黑体 (Archivo Black / Noto Sans SC/JP Black) */
  font-size: var(--fs-xs);
  font-weight: 900;
  font-synthesis: none;
  letter-spacing: 0.02em;   /* mono 的宽距(0.075em)在黑体下太散, 收紧 */
  outline: 0;
  box-shadow: none;
  overflow: hidden;
  animation: unlock-fade-up var(--dur-base) var(--ease-out) 500ms both;
}
.unlock-pill::after {
  content: "";
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 58px;
  left: -68px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 244, 184, .22) 22%, rgba(255,255,255,.94) 50%, rgba(255, 240, 159, .30) 76%, transparent 100%);
  box-shadow: 0 0 13px rgba(255, 241, 170, .72);
  transform: skewX(-20deg);
  animation: unlock-pill-sparkle 2300ms cubic-bezier(.2,.75,.25,1) 700ms infinite;
}
.unlock-pill__dice {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.unlock-pill__dice img {
  width: 1em;
  height: 1em;
  display: block;
}
.unlock-pill > span { position: relative; z-index: 1; }

/* ═══ 入场动画 ═══ */
@keyframes unlock-pop {
  0%   { opacity: 0; transform: scale(0.72) rotate(-3deg); }
  60%  { opacity: 1; transform: scale(1.02) rotate(0.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes unlock-art-drop {
  from { opacity: 0; transform: translateY(-40px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes unlock-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sparkle-blink {
  0%   { opacity: 0; transform: scale(0.4) rotate(-30deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes unlock-pill-sparkle {
  0%, 54%, 100% { left: -60px; opacity: 0; }
  8% { opacity: 1; }
  30% { left: calc(100% + 22px); opacity: .9; }
  36% { left: calc(100% + 22px); opacity: 0; }
}
/* 手机竖屏 · 保留美术破框 (overflow: visible 承自基础态), 只放宽 max-height 防超屏
   注意: 不要在这里加 overflow-y: auto —— 会把 unlock-art-stage 顶部 -32px 破框裁掉 */

@media (orientation: portrait) {
:where(:root[data-layout="mobile"]) {

  .unlock-dialog {
    max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

}
}


@media (orientation: portrait) {
:where(:root[data-layout="mobile"]) {

  .unlock-art-stage,
  .unlock-emoji {
    width: 168px;
    height: 168px;
  }
  .unlock-art-stage { margin-top: -24px; }
  .unlock-emoji { font-size: 80px; }
  .unlock-flourish { font-size: 46px; }
  .unlock-body h2 { font-size: var(--fs-lg); }
  .unlock-quote { font-size: var(--fs-sm); }
  .unlock-pill { font-size: 10px; padding-inline: 12px; }

}
}


/* Round 0 隐藏惊喜步: 解锁弹窗停留 1.5s 后自动淡出 (无需玩家点 ×) → 切投骰教学 */
.unlock-dialog.is-auto-closing {
  animation: unlock-auto-fade 400ms var(--ease-out) forwards;
}
@keyframes unlock-auto-fade {
  to { opacity: 0; transform: scale(0.94); }
}

@media (prefers-reduced-motion: reduce) {
  .unlock-dialog, .unlock-art-stage, .unlock-flourish,
  .unlock-body h2, .unlock-quote, .unlock-pill, .unlock-sparkle {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
  .unlock-dialog.is-auto-closing { animation: none; opacity: 0; }
}

/* ───────────── 票据打印机机头 · 外扩包住票据(左右突出) · 金/墨 简洁精致 ───────────── */
/* 机头满 dialog 宽; 票据 body 缩进(在 ticker) 使机头视觉包住票据两侧 · 不外扩 dialog 避免溢出 */
.printer { margin: 0 0 var(--s-2); position: relative; z-index: 3; }
/* 机身 · 深墨渐变 + 金边 + 顶部高光(塑料机器质感) */
.printer__body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  border-radius: var(--r-lg) var(--r-lg) 5px 5px;
  background: linear-gradient(180deg, #2c2418 0%, var(--ink) 100%);
  border: 2px solid var(--c-gold-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.printer__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--paper);
}
.printer__led {
  margin-left: auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sand-gold);
  box-shadow: 0 0 10px var(--sand-gold);
  animation: printer-led 1.8s ease-in-out infinite;
}
@keyframes printer-led { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
/* 出纸口 · 深凹槽 + 中间纸缝亮线(票据从此吐出) · 放大 */
.printer__slot {
  position: relative;
  height: 22px;
  margin: 0 10px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #000 0%, #1a1610 100%);
  border: 2px solid var(--c-gold-dark);
  border-top: 0;
  box-shadow: inset 0 5px 9px rgba(0, 0, 0, 0.7);
}
.printer__slot::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 5px;
  height: 3px;
  border-radius: 2px;
  background: var(--paper);
  box-shadow: 0 0 6px rgba(255, 247, 230, 0.55);
}

/* ─────────────  轮次结算 Modal (打印机下方 = 吐出的小票)  ───────────── */
/* ─────────────  Round End Modal · 两列布局  ─────────────
   eyebrow → [左 emote 放大 | 右 title + quote] → 单 CTA
   大圆角 / 大留白 / 呼吸感 / 美术资产视觉焦点 */
.round-end-dialog {
  position: relative;
  width: min(calc(100% - 32px), 480px);
  border: 0;
  border-radius: var(--r-2xl);
  /* 视觉对齐: 左 chibi PNG 自带 7-16% 透明内缩(实际内容距弹窗左缘 ≈ padding+26px ≈ 50px),
     而文字紧贴 h2 盒右缘。右边距比左边多半档 (s-5→s-6) 让文字右缘 ≈40px,
     视觉与左 chibi 实际内容左缘对齐, 避免「文字贴边, 美术悬空」。 */
  padding: var(--s-4) var(--s-6) var(--s-4) var(--s-5);
  background: var(--paper-elevated);
  box-shadow:
    0 40px 100px rgba(31, 26, 15, 0.28),
    0 8px 24px rgba(230, 169, 76, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: round-end-pop var(--dur-slow) var(--ease-doodle);
}
/* 通关彩带 · 弹窗打开时从顶部同步飘落 */
.round-end-confetti {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.round-end-confetti i {
  --x: 8%;
  --drift: 12px;
  --spin: 360deg;
  position: absolute;
  top: -28px;
  left: var(--x);
  width: 7px;
  height: 18px;
  border-radius: 2px;
  background: var(--c-gold);
  box-shadow: 0 0 8px rgba(230, 169, 76, 0.3);
  opacity: 0;
  transform: translate3d(0, -20px, 0) rotate(0);
  animation: none;
}
.round-end-dialog[data-celebrate='true'] .round-end-confetti i {
  animation: round-end-confetti-fall 1400ms var(--ease-out) var(--delay, 0ms) both;
}
/* 通关彩带 · 色板来自 tokens --confetti-*(冷金蓝白收敛: 浅金/青蓝/冷金/冰蓝/白/深青) */
.round-end-confetti i:nth-child(1)  { --x: 7%;  --drift: 18px; --spin: 420deg; --delay: 40ms;  background: var(--confetti-1); }
.round-end-confetti i:nth-child(2)  { --x: 15%; --drift: -9px; --spin: -330deg; --delay: 170ms; background: var(--confetti-2); height: 13px; }
.round-end-confetti i:nth-child(3)  { --x: 24%; --drift: 14px; --spin: 520deg; --delay: 90ms;  background: var(--confetti-3); }
.round-end-confetti i:nth-child(4)  { --x: 34%; --drift: -18px; --spin: -450deg; --delay: 260ms; background: var(--confetti-4); height: 14px; }
.round-end-confetti i:nth-child(5)  { --x: 43%; --drift: 10px; --spin: 390deg; --delay: 120ms; background: var(--confetti-5); }
.round-end-confetti i:nth-child(6)  { --x: 52%; --drift: -12px; --spin: -520deg; --delay: 300ms; background: var(--confetti-1); height: 12px; }
.round-end-confetti i:nth-child(7)  { --x: 60%; --drift: 17px; --spin: 460deg; --delay: 60ms;  background: var(--confetti-2); }
.round-end-confetti i:nth-child(8)  { --x: 68%; --drift: -15px; --spin: -380deg; --delay: 220ms; background: var(--confetti-3); height: 15px; }
.round-end-confetti i:nth-child(9)  { --x: 76%; --drift: 9px;  --spin: 540deg; --delay: 130ms; background: var(--confetti-4); }
.round-end-confetti i:nth-child(10) { --x: 84%; --drift: -17px; --spin: -430deg; --delay: 340ms; background: var(--confetti-5); height: 13px; }
.round-end-confetti i:nth-child(11) { --x: 91%; --drift: 13px; --spin: 370deg; --delay: 190ms; background: var(--confetti-1); }
.round-end-confetti i:nth-child(12) { --x: 96%; --drift: -12px; --spin: -500deg; --delay: 280ms; background: var(--confetti-6); height: 14px; }

.round-end-dialog form,
.round-end-hero { position: relative; z-index: 1; }

.round-end-dialog form {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  text-align: left;
}

/* 状态 eyebrow · 宽字距英文小标, 收在右上文字区 */
.round-end-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-3xs);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--c-ink-soft);
  animation: round-end-fade var(--dur-base) var(--ease-out) 100ms both;
}
.round-end-dialog[data-result='success'] .round-end-eyebrow,
.round-end-dialog[data-result='clear']  .round-end-eyebrow { color: var(--c-gold-dark); }
.round-end-dialog[data-result^='fail']  .round-end-eyebrow { color: var(--c-danger); }

/* 横版 hero 区: 左图右文, 右列依次 eyebrow / 称号 / NEXT */
.round-end-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  min-height: min(32vh, 220px);
  animation: round-end-fade var(--dur-base) var(--ease-out) 220ms both;
}
.round-end-art {
  align-self: stretch;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  /* Q 版美术轻量蓝晕: 仅比资产本体略大，不占满左列 */
  background: radial-gradient(42% 42% at 50% 48%,
    rgba(126, 199, 242, 0.32) 0%,
    rgba(178, 216, 246, 0.14) 52%,
    rgba(255, 255, 255, 0) 76%);
  border-radius: 50%;
}
.round-end-copy {
  min-width: 0;
  display: grid;
  gap: var(--s-3);
  align-content: center;
  justify-items: start;
  text-align: left;
}
/* 称号 · 收字号兜底 + 长称号允许折 2 行 (英文 "Promoted to Middle Class" 23 字符)。
   换行质量 (用户反馈日文"中流階級に昇格"被拆成 6+1 孤字掉行):
   - text-wrap:balance  必须换行时浏览器自动让两行长度均衡, 避免一长一短/孤字掉行 (Chrome 114+/Safari 17.5+);
   - 不用 -webkit-box line-clamp —— 它与 balance/keep-all 冲突会抑制换行导致硬截断(实测 bug);
     称号文案本就 ≤2 行, 用 max-height 兜底防极端超长即可。 */
.round-end-hero h2 {
  margin: 0;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 900;
  /* 上限 32→28: 480px 弹窗右列 209px, "Promoted to Bourgeoisie" 32px 时 Bourgeoisie 单词 210px 塞不下被截断;
     28px 时 ≈184px 从容两行内显示, 与左 chibi 视觉权重也更均衡 (原 32px 与 chibi 抢戏) */
  font-size: clamp(22px, 4.5vw, 28px);
  color: var(--c-ink);
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-align: left;
  text-wrap: balance;            /* 两行均衡换行 */
  max-height: 2.6em;             /* 兜底: 最多 2 行高, 极端超长截断 */
  overflow: hidden;
  overflow-wrap: break-word;     /* 单词仍允许断 (英文长词), balance 负责行宽均衡 */
}
/* Q 版小人 · 铺满左列 */
.round-end-emote {
  width: 100%;
  height: 100%;
  min-height: min(30vh, 200px);
  max-height: min(36vh, 240px);
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 14px 28px rgba(31, 26, 15, 0.16));
}
.round-end-emote[hidden] { display: none; }
.round-end-art:has(.round-end-emote[hidden]) { display: none; }
.round-end-art:has(.round-end-emote[hidden]) + .round-end-copy {
  grid-column: 1 / -1;
  justify-items: center;
  text-align: center;
}
.round-end-art:has(.round-end-emote[hidden]) + .round-end-copy h2 { text-align: center; }

/* NEXT · 收进右列，左对齐但不再撑满；右侧留白与左侧人物边距呼应 */
.round-end-dialog .dialog-actions {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-start;
  width: 100%;
  margin-top: var(--s-2);
  animation: round-end-fade var(--dur-base) var(--ease-out) 340ms both;
}
.round-end-dialog .primary-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* 94%→78%: 配合右 padding s-6 视觉对齐 chibi 实际内容左缘, 按钮右缘不再贴边 */
  width: clamp(132px, 78%, 200px);
  min-height: 48px;
  padding: 12px 22px;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--c-ink-deep) !important;
  background: linear-gradient(135deg, var(--sand-gold-hi) 0%, var(--sand-gold) 48%, var(--c-gold-dark) 100%) !important;
  box-shadow:
    var(--shadow-gold),
    0 0 0 1px rgba(255, 255, 255, 0.34) inset,
    0 0 20px rgba(230, 169, 76, 0.2);
  animation:
    round-end-cta-arrive 620ms var(--ease-doodle) 320ms both,
    round-end-cta-glow 2200ms ease-in-out 1100ms infinite;
}
.round-end-dialog .primary-button::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 28%, rgba(255, 255, 255, 0.68) 50%, transparent 72%);
  transform: translateX(-130%);
  animation: round-end-cta-shimmer 2400ms ease-in-out 850ms infinite;
}
.round-end-dialog .primary-button::after {
  content: '✦';
  position: absolute;
  top: 4px;
  right: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
  animation: round-end-cta-sparkle 1800ms ease-in-out 700ms infinite;
}
.round-end-dialog .primary-button:hover {
  background: linear-gradient(135deg, var(--sand-gold-hi) 0%, var(--sand-gold) 48%, var(--c-gold-dark) 100%) !important;
  transform: translateY(-2px) scale(1.02);
}
.round-end-dialog .primary-button:active { transform: translateY(0) scale(0.98); }

/* 图片缺失时单列居中：CTA 仍保持紧凑，不回到整行长按钮 */
.round-end-art:has(.round-end-emote[hidden]) + .round-end-copy .dialog-actions { justify-content: center; }

/* 小屏: 进一步收紧 padding, 横版两列保留 */

:where(:root[data-layout="mobile"]) {

  .round-end-dialog {
    width: min(calc(100% - 16px), 400px);
    padding: var(--s-4) 12px var(--s-4);
  }
  /* 其余弹窗宽度与晋升弹窗拉齐 (手机档) */
  .intro-dialog,
  .unlock-dialog {
    width: min(calc(100% - 16px), 400px);
  }
  .round-end-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    min-height: min(28vh, 180px);
    gap: var(--s-3);
  }
  .round-end-hero h2 { font-size: clamp(19px, 6vw, 26px); }
  .round-end-emote {
    min-height: min(26vh, 160px);
    max-height: min(30vh, 200px);
  }
  .round-end-dialog .primary-button {
    width: clamp(118px, 100%, 142px);
    min-height: 44px;
    padding: 10px 16px;
    font-size: var(--fs-xs);
  }

}


/* iPad Safari 会把原生 dialog 以 absolute 定位到文档流中心；页面已滚动时弹窗会跑到视口外。
   iPad 上显式固定到 visual viewport，避免轮次结算 / 解锁 / 关卡介绍不可见。 */

:where(:root[data-layout="tablet"]) {

  .intro-dialog,
  .unlock-dialog,
  .round-end-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  /* .focus-bar iPad 竖屏 (834×1194) 目前复用 desktop 基础样式 (line 841+), 未做 tablet 专属定制。
     若后续在 iPad 竖屏出现字号/间距不合适, 在此追加 .focus-bar/.focus-goal 规则;
     iPad 横屏矮屏定制在 line 1262 (orientation:landscape + max-height:1024px) 已单独处理。 */

}


/* 入场动画 */
@keyframes round-end-pop {
  0%   { opacity: 0; transform: scale(0.86) translateY(12px); }
  60%  { opacity: 1; transform: scale(1.01) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes round-end-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes round-end-cta-arrive {
  from { opacity: 0; transform: translateY(14px) scale(0.9); }
  65%  { opacity: 1; transform: translateY(-2px) scale(1.03); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes round-end-cta-glow {
  0%, 100% {
    box-shadow: var(--shadow-gold), 0 0 0 1px rgba(255, 255, 255, 0.34) inset, 0 0 14px rgba(230, 169, 76, 0.14);
  }
  50% {
    box-shadow: 0 14px 34px rgba(230, 169, 76, 0.44), 0 0 0 1px rgba(255, 255, 255, 0.5) inset, 0 0 30px rgba(230, 169, 76, 0.34);
  }
}
@keyframes round-end-cta-shimmer {
  0%, 55% { transform: translateX(-130%); }
  100%    { transform: translateX(130%); }
}
@keyframes round-end-cta-sparkle {
  0%, 100% { opacity: 0.35; transform: scale(0.7) rotate(0); }
  50%      { opacity: 1; transform: scale(1.15) rotate(20deg); }
}
@keyframes round-end-confetti-fall {
  0%   { opacity: 0; transform: translate3d(0, -24px, 0) rotate(0); }
  12%  { opacity: 1; }
  80%  { opacity: 0.95; }
  100% { opacity: 0; transform: translate3d(var(--drift), 270px, 0) rotate(var(--spin)); }
}
@media (prefers-reduced-motion: reduce) {
  .round-end-dialog, .round-end-eyebrow, .round-end-hero,
  .round-end-dialog .dialog-actions, .round-end-dialog .primary-button,
  .round-end-dialog .primary-button::before, .round-end-dialog .primary-button::after,
  .round-end-confetti i {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
  .round-end-confetti { display: none; }
}

.grid-empty {
  padding: var(--s-7) var(--s-4);
  text-align: center;
  color: var(--c-ink-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  grid-column: 1 / -1;
}

/* ─── 玩法说明入口与短说明弹窗 ─── */
.tutorial-help-button {
  position: fixed;
  z-index: var(--z-raised);
  right: max(var(--s-3), env(safe-area-inset-right));
  /* 固定在结算栏上方：商品区滚动时仍始终可重看，且不占卡片排版空间。 */
  bottom: calc(76px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: var(--c-ink-deep);
  color: #fff;
  box-shadow: 0 6px 18px rgba(31, 26, 15, 0.26);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms var(--easing-spring-out), background 160ms ease, box-shadow 160ms ease;
}
.tutorial-help-button:hover { background: var(--ink-hi); transform: translateY(-2px); }
.tutorial-help-button:active { transform: scale(0.94); }
.tutorial-help-button:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 3px; }

.tutorial-help-dialog {
  width: min(calc(100% - 32px), 420px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--c-bg-elevated);
  color: var(--c-ink);
  box-shadow: 0 24px 70px rgba(31, 26, 15, 0.36), 0 0 0 1px rgba(230, 169, 76, 0.26);
}
.tutorial-help-dialog::backdrop {
  background: rgba(31, 26, 15, 0.44);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.tutorial-help-dialog form { margin: 0; padding: var(--s-5); }
.tutorial-help-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.tutorial-help-dialog__head h2 {
  margin: 0;
  color: var(--c-ink-deep);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
}
.tutorial-help-dialog__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(31, 26, 15, 0.07);
  color: var(--c-ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.tutorial-help-dialog__close:hover { background: rgba(31, 26, 15, 0.14); }
.tutorial-help-dialog__list {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-4) 0 0;
  /* 2026-09-03 fix: 原 padding-left:1.35em 刚好只容 marker 数字,
     视觉上 1./2. 编号紧贴弹窗左缘, 看起来拥挤。
     整体再向左让出 var(--s-2) (8px), 编号与文字一起内移, 左右呼吸一致。 */
  padding: 0 var(--s-2) 0 calc(1.35em + var(--s-3));
  color: var(--c-ink-soft);
  font-family: var(--font-quote);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.tutorial-help-dialog__list li::marker { color: var(--c-gold-dark); font-family: var(--font-mono); font-weight: 700; }

:where(:root[data-layout="mobile"]) {
  /* 2026-09-03 fix: 底部截断 · 原 bottom:62px+safe-area 距 checkout-bar(top:786)仅 4px,
     iOS 弹跳/视口收缩时按钮底部会被 checkout-bar 覆盖裁切。
     提到 78px: 与 checkout-bar (46px高) 拉开 32px 间距, 任何情况下都不被遮。 */
  /* 2026-09-03 缩小 ?: 40→32, 字号 20→15; bottom 随底栏(38px)下调 78→68, 仍与底栏拉开间距不被遮 */
  .tutorial-help-button { right: max(var(--s-2), env(safe-area-inset-right)); bottom: calc(68px + env(safe-area-inset-bottom)); width: 32px; height: 32px; font-size: 15px; }
  .tutorial-help-dialog form { padding: var(--s-4); }
  .tutorial-help-dialog__list { gap: var(--s-2); font-size: var(--fs-xs); }
}

/* 2026-09-04 fix: PC 端 ? 按钮"消失"——基础 bottom:76px 假设底栏占 76px,
   但 desktop 底栏实际 = checkout 56px + root padding-bottom 24px = 80px,
   按钮底部 4px 压进金色骰子长条背景, 44px 黑圆点贴在底栏上缘视觉融入不可见。
   tablet/desktop 提到 96px (80 底栏 + 16 间距), 与 mobile 一样始终完整浮在底栏上方。 */
:where(:root[data-layout="tablet"], :root[data-layout="desktop"]) {
  .tutorial-help-button { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
/* desktop 矮屏档 (max-height:1000): 底栏压缩为 checkout 48 + root padding 8 = 56px,
   同步下调 bottom 到 72px (56 + 16 间距), 避免按钮在矮屏下飘得过高。 */
@media (max-height: 1000px) {
  :where(:root[data-layout="desktop"]) {
    .tutorial-help-button { bottom: calc(72px + env(safe-area-inset-bottom)); }
  }
}

/* ─── 骰子剩余次数 ─── */
.dice-remaining {
  align-self: center;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  /* 2026-09-06: 深金 #E39A2E 在亮金底 #F2B33D 上对比度太低看不清, 改黑墨色 */
  color: var(--c-ink-deep);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* is-last = 剩 1 次 (仍可投): 高亮 + 跳动提醒。耗尽 (disabled) 后纯灰静止, 不再跳动。 */
.dice-button.is-last:not(:disabled) {
  background: var(--sand-gold-hi);
  animation: dice-last-pulse 0.9s ease-in-out infinite;
}
/* 次数耗尽: 纯灰静止, is-last 的高亮与跳动都收掉 (2026-09-04 用户反馈) */
.dice-button.is-last:disabled {
  background: rgba(31, 26, 15, 0.06);
  animation: none;
}
@keyframes dice-last-pulse {
  0%,100% { transform: scale(1);    }
  50%     { transform: scale(1.04); }
}
/* is-last 完整文案 "最后一赌!" 不收缩; PC 按桌面态回填 grow 与正常态等宽 */
.checkout-bar .dice-button.is-last {
  flex: 0 0 auto;
  max-width: none;
}
/* 2026-09-04 用户反馈: 手机端投骰到最后一个按钮自动缩短 → 全程保持与常态相同的
   flex 分配, 不因 is-last 文案变长而收缩(收缩会让按钮视觉突变)。
   用三重复类把特异性提到 (0,4,0) 压过 styles.css 的 (0,3,0) is-last.is-last 段,
   确保手机端 is-last 不再收缩。 */
:where(:root[data-layout="mobile"]) .checkout-bar .dice-button.is-last.is-last.is-last {
  flex: 5 1 0; /* 投骰 5/8 */                /* 2026-09-06: 常态 5:3 (投骰 5 / 结算 3), is-last 同步 */
  max-width: none;
  min-width: 0;
}
:root[data-layout="desktop"] .checkout-bar .dice-button.is-last {
  /* 2026-09-06: 桌面骰子已改 3:1 (投骰 3 份), is-last 同步保持 3 份 */
  flex: 5 1 0; /* 投骰 5/8 */
  min-width: 0;
  max-width: none;
}

/* ─── 载体微异常线索 ─── */
/* stomp: 异常动画只作用于美术层，不覆盖整卡 hover 位移。 */
.item-card[data-anomaly='stomp']:hover .item-art,
.item-card[data-anomaly='stomp']:hover .item-emoji {
  animation: anomaly-stomp 0.4s var(--easing-bounce);
}
@keyframes anomaly-stomp {
  0%,100% { transform: translateY(0) scaleY(1); }
  40%     { transform: translateY(2px) scaleY(0.94); }
  70%     { transform: translateY(-4px) scaleY(1.03); }
}
/* typo_poor: 星穷列车 "穷" 字红色错位 */
.typo-poor {
  display: inline-block;
  color: var(--c-danger);
  transform: translateY(-2px) rotate(-4deg);
  font-weight: 900;
}
.item-card[data-anomaly='typo_poor']:hover .item-emoji { animation: anomaly-flip 0.5s ease; }
@keyframes anomaly-flip { 0%,100%{transform:rotate(-4deg);} 50%{transform:rotate(-4deg) scaleX(-1);} }

@media (prefers-reduced-motion: reduce) {
  .dice-button.is-last { animation: none !important; }
  .countdown-display.is-bonus-bump,
  .countdown-bonus { animation: none !important; }
}

/* challenge-root 间距收紧 · position 供内部绝对定位参考 */
.challenge-root { position: relative; }

/* 目标 bar · 通关三要素收束: Round/玩家 + 大倒计时 + 花光金额进度 + 需触发彩蛋
   单屏禁滚后不再 sticky, 不随滚动压缩;  padding/间距收拢, 倒计时保留大号视觉 */
.focus-bar {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-2xl);
  flex: 0 0 auto;               /* 单屏 flex 列里固定不伸缩 */
  /* 去玻璃拟态 · paper-elevated 实底 + 细描边 · 对齐 Hero/wealth-hud */
  background: var(--paper-elevated);
  box-shadow: var(--shadow-hairline);
  text-align: center;
  overflow: hidden;   /* 裁掉溢出的幽灵数字 */
  position: relative;
}
/* 巨型幽灵关卡数字 (01/02/03) · 靠右被边缘截断 · 垫底 · 电影感层级
   加深到 0.10 让装饰意图明确, 不再像淡到失焦的 bug */
.focus-bar::before {
  content: attr(data-round);
  position: absolute;
  top: 50%;
  right: 0.02em;              /* T1: 收进框内, 不再出血 */
  transform: translateY(-50%);
  z-index: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(64px, 12vw, 110px);  /* T1: 原 96/20vw/168, 缩小让出倒计时视区 */
  line-height: 1;
  letter-spacing: -0.06em;
  color: rgba(31, 26, 15, 0.08);  /* T1: 0.10→0.08 更淡, 退到装饰层 */
  pointer-events: none;
}
/* 焦点层真实内容压在幽灵数字之上 */
.focus-bar > * { position: relative; z-index: 1; }

/* ─── 目标面板 · Round/玩家/倒计时 辅助行 ─── */
.focus-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: nowrap;
}
.stage-name {
  padding: 6px 16px;
  border-radius: var(--r-full);
  background: var(--sand-gold);
  color: var(--c-ink-deep);
  /* 关卡名标签 mono uppercase · 呼应 Hero kicker 编辑感 · 扁平实色 */
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  flex-shrink: 0;
}
/* .stage-player 已移除 —— 挑战者名字仅在 receipt / share 卡展示 */
/* 删除倒计时左侧 Round 角标(三端) · 普通/教学模式隐藏整行(元素留 DOM, render.js 仍靠 #roundBadge
   写 data-round/data-mode); MAX OUT MODE 由下方 [data-mode='endless'] .focus-head 覆盖回显"MAX OUT MODE"。 */
.focus-bar:not([data-mode='endless']) .focus-head { display: none; }
.focus-bar .countdown-display {
  display: block;
  /* PC: 倒计时独占一行 · 居中放大, 目标面板视觉焦点 */
  margin: 0 auto;
  text-align: center;
  font-family: 'Archivo Black', var(--font-display);   /* 倒计时数字三语言统一 Archivo Black (与 EN 一致) */
  font-size: clamp(64px, 8vw, 100px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: var(--c-ink-deep);
  flex-shrink: 0;
  transition: color 200ms ease, transform 160ms var(--easing-out);
}

/* 加时感知 · 继续探索后倒计时数字弹动 (+20s 跳动)
   !important 压住 warning/danger 相位的常驻 breathe/pulse 循环动画, bump 620ms 期间优先弹动 */
.countdown-display.is-bonus-bump {
  animation: countdown-bonus-bump 620ms var(--easing-out) !important;
}
/* 药师赐福收尾的 bump 与摘除 is-spotlit 同帧: 数字刚脱离 is-spotlit 抬升(z=spotlight+2)会掉回
   focus-bar 局部层级(z=1), 被仍在淡出的药师覆盖层(z=spotlight)压住 → bump 期间把数字抬到覆盖层之上,
   保证弹动(以及同刻的 +Ns 徽章)在覆盖层淡出过程里清晰可见。仅作用 bump 这 620ms, 动画结束 class 即摘。 */
.countdown-display.is-bonus-bump:not(.is-spotlit) {
  position: relative;
  z-index: calc(var(--z-spotlight) + 2);
}
@keyframes countdown-bonus-bump {
  0%   { transform: scale(1);    color: var(--c-ink-deep); }
  18%  { transform: scale(1.22); color: var(--sand-gold); }   /* 弹大 + 转金 */
  40%  { transform: scale(0.94); }
  62%  { transform: scale(1.06); color: var(--sand-gold); }
  100% { transform: scale(1);    color: var(--c-ink-deep); }
}

/* +Ns 浮起徽章 · 从倒计时右侧上浮淡出, 告知加时量 */
.countdown-bonus {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(28%, -50%);   /* 落在倒计时数字右侧 */
  margin-left: 0.18em;
  font-family: 'Archivo Black', var(--font-display);   /* 加时徽章 +Ns 三语言统一 Archivo Black */
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 30px);
  color: var(--sand-gold);
  text-shadow: 0 2px 6px rgba(31, 26, 15, 0.28);
  pointer-events: none;
  z-index: 2;
  animation: countdown-bonus-float 1100ms var(--easing-out) forwards;
}
/* 药师收尾的徽章改挂 body 顶层 (countdown.js --fixed): fixed 定位 + 抬层级压过药师 fx 覆盖层
   (--z-spotlight=1000) 与聚焦倒计时 (is-spotlit=spotlight+2), 确保覆盖层淡出那刻徽章清晰可见。
   transform 交给 countdown-bonus-float 动画各帧驱动, 这里不写静态 transform 避免互相覆盖。 */
.countdown-bonus--fixed {
  position: fixed;
  z-index: calc(var(--z-spotlight) + 3);
  margin-left: 0.55em;              /* 从数字中线再向右让出半字宽, 不遮数字本体 */
  text-shadow: 0 2px 8px rgba(31, 26, 15, 0.4), 0 0 14px rgba(232, 204, 122, 0.5);   /* 压过覆盖层暗化更醒目 */
}
@keyframes countdown-bonus-float {
  0%   { opacity: 0;  transform: translate(28%, -30%) scale(0.6); }
  18%  { opacity: 1;  transform: translate(28%, -50%) scale(1); }
  100% { opacity: 0;  transform: translate(28%, -160%) scale(0.92); }
}

/* PC · 倒计时区占比收小: 上下内边距收紧 (仅 desktop, 不动 mobile/iPad)。
   置于基础规则之后以覆盖同特异性。 */
:where(:root[data-layout="desktop"]) {
  .focus-bar { padding: var(--s-2) var(--s-5); }               /* 上下 12→8 */
}

/* ─── 双目标面板 · 金额/彩蛋 标签+数值 醒目 ─── */
.focus-goals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-4);
  width: 100%;
}
.focus-goal {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-width: 0;
}
.focus-goal--right { justify-items: end; text-align: right; }
/* 左栏左对齐: 覆盖 .focus-bar 的 text-align:center。mobile 下 value 有 width:100% 会继承居中,
   使金额数值浮到列中间与标签脱节 → 显式左对齐, 与右栏右对齐镜像(标签+数值各自顶到本侧边)。 */
.focus-goal--left { justify-items: start; text-align: left; }
/* 标签用 display 字体, 更清爽, 不再 uppercase */
.focus-goal__label {
  font-family: var(--font-display);
  font-size: clamp(15px, 4.2vw, 18px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--c-ink-soft);
}
/* 数值放大 · 目标金额/彩蛋成为目标面板视觉锚点 */
.focus-goal__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(17px, 4.6vw, 22px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--c-ink-deep);
  white-space: nowrap;
}
.focus-goal--left .focus-goal__value  { color: var(--c-gold-dark); }
.focus-goal--right .focus-goal__value { color: var(--c-gold-dark); }
/* 目标紧急态只用颜色/呼吸动画表达，不新增任何提示文字。 */
.focus-goal[data-state='warning'] .focus-goal__value {
  animation: focus-goal-warning 1.4s ease-in-out infinite;
}
.focus-goal[data-state='danger'] .focus-goal__value {
  color: var(--c-danger);
  animation: focus-goal-danger 0.72s ease-in-out infinite;
}
.focus-goal[data-state='done'] .focus-goal__value {
  color: var(--c-gold-dark);
  animation: none;
}
@keyframes focus-goal-warning {
  0%, 100% { opacity: 1; filter: saturate(1); }
  50% { opacity: 0.62; filter: saturate(1.3); }
}
@keyframes focus-goal-danger {
  0%, 100% { opacity: 1; scale: 1; }
  50% { opacity: 0.62; scale: 1.035; }
}

/* ─── 双汇合进度条 · 加高 · 左:金额(左→中) 右:彩蛋(右→中) · 中点会师 ─── */
.focus-converge { width: 100%; min-width: 0; }
.focus-converge__track {
  position: relative;
  height: 10px;                 /* 扁平, 贴彩蛋条气质 */
  border-radius: var(--r-full);
  background: rgba(31, 26, 15, 0.07);   /* 浅透轨道 · 无内阴影, 去 3D 凹槽感 */
  overflow: hidden;
}
/* 中点刻度 · 会师目标线 · 暖金菱形指示, 双向汇合点明确 */
.focus-converge__mid {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--c-gold-warm);
  border-radius: 2px;
  transform: rotate(45deg);
  z-index: 2;
  box-shadow: 0 0 0 2px var(--paper-elevated), 0 0 8px rgba(232, 168, 69, 0.5);
}
.focus-converge__fill {
  position: absolute;
  top: 0;
  height: 100%;
  width: 0;
  transition: width 480ms var(--easing-spring-out);
}
/* 左 fill · 金额: 亮白金→暖金 (左→中, max 50%), 汇聚中点成金 */
.focus-converge__fill--left {
  left: 0;
  max-width: 50%;
  border-radius: var(--r-full) 0 0 var(--r-full);
  background: var(--grad-amt);
  box-shadow: 0 0 8px rgba(242, 205, 126, 0.55);
}
/* 右 fill · 彩蛋: 亮蓝→暖金 (右→中, max 50%), 汇聚中点成金 */
.focus-converge__fill--right {
  right: 0;
  max-width: 50%;
  border-radius: 0 var(--r-full) var(--r-full) 0;
  background: var(--grad-egg);
  box-shadow: 0 0 8px rgba(226, 201, 142, 0.5);
}
/* 两侧会师通关 · 金橙脉动 */
.focus-converge__track.is-cleared .focus-converge__fill--left,
.focus-converge__track.is-cleared .focus-converge__fill--right {
  animation: goal-pulse 1.2s ease-in-out infinite;
}
.focus-converge__track.is-cleared .focus-converge__mid {
  background: var(--c-gold-warm);
  box-shadow: 0 0 10px var(--c-gold);
}
/* ─── MAX OUT MODE · 双向 PK 热力条 (左=玩家花费 / 右=砂金财富) ─── */
/* 1) 无尽模式左上角角标: 固定显示 MAX OUT MODE, 样式收小弱化 (是模式标识不是标题)
   青蓝底+藏青字 · 与左侧玩家花费青蓝同族, 不再用淡金(避免与右侧金色财富混淆) */
.focus-bar[data-mode='endless'] .focus-head { display: flex; }
.focus-bar[data-mode='endless'] .stage-name {
  padding: 3px 10px;
  font-size: 11px;
  background: rgba(126, 200, 227, 0.18);   /* 淡青蓝底 */
  color: var(--c-navy);                     /* 藏青字 */
  letter-spacing: 0.08em;
  /* 2026-09-04: 顶部 HUD 统一 Archivo Black (用户反馈字体混乱)
     覆盖 .stage-name 默认 var(--font-mono) → Archivo Black 单字重 400, 避免 faux-bold */
  font-family: 'Archivo Black', var(--font-display);
  font-weight: 400;
  font-synthesis: none;
}
/* 1.5) 无尽模式不显示幽灵背景字 (data-round 不再写入, 双保险 content:none) */
.focus-bar[data-mode='endless']::before { content: none; }
/* 2) 模式专属元素显隐: 普通显彩蛋目标, 无尽显砂金财富 */
.focus-bar[data-mode='endless'] .mode-normal { display: none; }
.focus-bar:not([data-mode='endless']) .mode-endless { display: none; }
/* 3) PK 条: 左 fill=玩家花费(冷色对抗), 右 fill=砂金财富(金色发光), 交界=战线, 各可推到 100% */
.focus-bar[data-mode='endless'] .focus-converge__mid { display: none; }
/* PK 条 → 单条五色连续渐变 (与普通模式 linear-gradient 同款):
   左 fill 铺整条光谱(蓝→浅蓝→浅金→金→深金), 随花费从左向右生长;
   右 fill 只作遮罩(轨道底色)从右盖住"未到"部分, 露出长度即花费进度。 */
.focus-bar[data-mode='endless'] .focus-converge__fill--left {
  max-width: 100%;
  border-radius: var(--r-full);               /* 整条胶囊圆角, 光谱铺满时两端皆圆 */
  background: var(--grad-pk-spectrum);
  box-shadow: 0 0 10px rgba(126, 200, 227, 0.35),
              0 0 14px rgba(232, 204, 122, 0.28);   /* 蓝金双色微光, 呼应光谱两端 */
}
.focus-bar[data-mode='endless'] .focus-converge__fill--right {
  max-width: 100%;
  border-radius: 0 var(--r-full) var(--r-full) 0;
  background: rgba(31, 26, 15, 0.07);          /* 与 track 底色一致 = 透明遮罩, 露出左光谱 */
  box-shadow: none;
}
/* 旧 PK 金侧脉冲/白线已随双色对抗语义移除, 单条渐变无需战线读数 */
/* 4) 倒计时区: 不再放大 (用户 2026-08-29 反馈: MAX OUT 倒计时太大压过财富数字),
   字号与普通模式 desktop 档一致 (clamp(52,5vw,72)), 让两侧财富金额成为视觉焦点 */
.focus-bar[data-mode='endless'] .countdown-display {
  font-size: clamp(48px, 5vw, 64px);
}
/* 危险态脉冲加速 0.9s→0.6s, 紧迫感更强 */
.focus-bar[data-mode='endless'] .countdown-display[data-phase='danger'] {
  animation: countdown-pulse 0.6s ease-in-out infinite;
}

/* 5) 无尽 PK 布局统一: 标签(文字)在上 → 金额在下, 左右两块结构对齐 */
/*    右列 grid item 占满列宽, 内部 flex-end 才能真贴到白框右边 (普通模式右列内容短不受影响) */
.focus-bar[data-mode='endless'] .focus-goal--right { justify-items: stretch; }
/* 6) 左右金额上色: 左=累积花费(浅青蓝, 与左 fill 渐变同色系) / 右=砂金财富(金色发光, 情感锚点微微"赢") */
.focus-bar[data-mode='endless'] .focus-goal--left .focus-goal__value {
  color: var(--c-cyan);   /* 浅青蓝 · 与左 fill 青蓝渐变同色系 */
  font-size: clamp(20px, 4.2vw, 30px);   /* 完整千分位金额优先，不再为大字号截断 */
  letter-spacing: -0.04em;
  white-space: nowrap;
}
/* 左侧标签也带青蓝 · 与金额/填充条同族, 不再是孤立的灰标签 */
.focus-bar[data-mode='endless'] .focus-goal--left .focus-goal__label {
  color: var(--c-navy);   /* 藏青 · 与青蓝渐变同族, 比灰更贴夏日海滩 */
  opacity: .85;
}
.focus-bar[data-mode='endless'] .wealth-hud--pk .wealth-hud__number {
  color: var(--c-gold-dark);   /* 砂金深金 · 财富积累 */
  text-shadow: 0 0 20px rgba(212, 165, 55, 0.18);   /* 极淡金色发光, 视觉微微占优 */
}
/* 右侧标签保持深金 · 与金额同族 */
.focus-bar[data-mode='endless'] .focus-goal--right .focus-goal__label {
  color: var(--c-gold-dark);
  opacity: .85;
}

/* 临近结束且目标未完成时，对应半边进度条同步呼吸；状态源仍只有顶部目标区。 */
.focus-bar:has(.focus-goal--left[data-state='warning']) .focus-converge__fill--left,
.focus-bar:has(.focus-goal--right[data-state='warning']) .focus-converge__fill--right {
  animation: focus-goal-warning 1.4s ease-in-out infinite;
}
.focus-bar:has(.focus-goal--left[data-state='danger']) .focus-converge__fill--left,
.focus-bar:has(.focus-goal--right[data-state='danger']) .focus-converge__fill--right {
  animation: focus-goal-danger 0.72s ease-in-out infinite;
  filter: saturate(1.35);
}
/* normal 态不呼吸 · 呼吸只留给 warning/danger · 让紧迫感来自节奏差异 */
.focus-bar .countdown-display[data-phase='normal'] {
  animation: none;
}
/* warning 跳动: 比 danger 脉冲(0.9s)慢一拍的 1.1s 心跳节奏, 双跳感 */
@keyframes countdown-beat {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.09); }
  24%      { transform: scale(1.0); }
  36%      { transform: scale(1.05); }
  52%      { transform: scale(1); }
}
/* 倒计时 warning: 红色+跳动, 提示紧迫(仍为红/黑两色体系, 不引入第三色) */
.focus-bar .countdown-display[data-phase='warning'] {
  color: var(--c-danger);
  animation: countdown-beat 1.1s ease-in-out infinite;
}
.focus-bar .countdown-display[data-phase='danger']  { color: var(--c-danger); animation: countdown-pulse 0.9s ease-in-out infinite; }
.focus-bar .countdown-display[data-phase='expired'] { color: var(--c-danger); opacity: 0.55; }

/* 暂停态: 数字暗色 + ⏸ 前缀提示玩家彩蛋/警告 dialog 期间不倒扣时间 */
.focus-bar .countdown-display[data-paused='true'] {
  color: var(--c-ink-soft);
  opacity: 0.6;
  animation: none;
}
.focus-bar .countdown-display[data-paused='true']::before {
  content: '⏸ ';
  font-size: 0.55em;
  vertical-align: middle;
  margin-right: 0.15em;
  opacity: 0.75;
}

/* goal-pulse · 双汇合进度会师脉动 (.focus-converge__track.is-cleared) */
@keyframes goal-pulse { 0%,100%{opacity:1;} 50%{opacity:0.75;} }

/* ═══ 会师达成庆祝 · 普通模式每轮首次双目标达成 (JS: goal-celebrate.js) ═══ */
/* 1) 整条变亮金 + 常驻金色外发光 (仅普通模式; 两侧 fill 统一染亮金, 贴 icon 色) */
.focus-bar:not([data-mode='endless']) .focus-converge__track.is-cleared {
  box-shadow: 0 0 16px rgba(242, 179, 61, 0.55);
}
.focus-bar:not([data-mode='endless']) .focus-converge__track.is-cleared .focus-converge__fill--left,
.focus-bar:not([data-mode='endless']) .focus-converge__track.is-cleared .focus-converge__fill--right {
  background: linear-gradient(180deg, #F8CD6E, #F2B33D 55%, #E39A2E);
  box-shadow: 0 0 12px rgba(242, 179, 61, 0.6);
}
/* 2) 会师瞬间金光迸发一下 · 收束到 is-cleared 的常驻外发光 */
.focus-converge__track.is-flash { animation: goal-converge-flash 520ms var(--ease-out); }
@keyframes goal-converge-flash {
  0%   { box-shadow: 0 0 0 0 rgba(242, 179, 61, 0); }
  25%  { box-shadow: 0 0 28px 6px rgba(248, 205, 110, 0.85); }
  100% { box-shadow: 0 0 16px rgba(242, 179, 61, 0.55); }
}
/* 3) 全屏 overlay 层 · 承载徽章/光环 · 脱离 focus-bar 的 overflow:hidden 裁切, 置于最上层完全显现 */
#goal-celebrate-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: var(--z-celebrate);   /* 高于 focus-bar，略低于金币 canvas。 */
}
/* 光环 · 从会师中点向外扩散一圈金光 (fixed, left/top 由 JS 写会师点视口坐标) */
.focus-converge__ring {
  position: fixed;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(240, 200, 120, 0.9);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}
.focus-converge__ring.is-expanding { animation: goal-ring-expand 620ms var(--ease-out) forwards; }
@keyframes goal-ring-expand {
  0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(0.4); border-width: 3px; }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(6);   border-width: 0.5px; }
}
/* 4) 火焰对勾成就徽章 · 坐在会师点上方完全显现, 弹入回弹 (fixed, left/top 由 JS 写) */
.focus-converge__badge {
  position: fixed;
  width: 84px; height: auto;
  transform: translate(-50%, -50%) scale(0.2);
  transform-origin: 50% 82%;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(184, 123, 38, 0.6));
  will-change: transform, opacity;
}
/* 手机端达成徽章缩小: 84px 在窄屏盖住金额/进度条/商品卡标题 (用户反馈) → 52px 减少遮挡
   2026-09-04: 用户再次反馈仍偏大 → 42px (火焰对勾徽章, 会师点弹入回弹, 不遮 HUD) */
:where(:root[data-layout="mobile"]) .focus-converge__badge { width: 42px; }
.focus-converge__badge.is-shown { opacity: 1; }
.focus-converge__badge.is-popping { animation: goal-badge-pop 640ms var(--ease-doodle) both; }
@keyframes goal-badge-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(-12deg); }
  55%  { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(4deg); }
  75%  {             transform: translate(-50%, -50%) scale(0.94) rotate(-2deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}
/* 5) 底部结算按钮 · 达成后跳动呼吸引导点击 (enabled 时才呼吸) */
.primary-button.is-goal-ready:not(:disabled) {
  animation: settle-breathe 1.5s var(--ease-out) infinite;
}
@keyframes settle-breathe {
  0%, 100% { transform: scale(1);     box-shadow: 0 6px 16px rgba(230, 169, 76, 0.35); }
  50%      { transform: scale(1.045); box-shadow: 0 12px 30px rgba(230, 169, 76, 0.6); }
}
/* reduced-motion 降级: 徽章直接定格, 光环/迸发/呼吸停, 结算按钮改静态金色高亮 */
@media (prefers-reduced-motion: reduce) {
  .focus-converge__track.is-flash,
  .focus-converge__ring.is-expanding,
  .focus-converge__badge.is-popping,
  .primary-button.is-goal-ready:not(:disabled) { animation: none; }
  .focus-converge__badge.is-shown {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  .primary-button.is-goal-ready:not(:disabled) {
    box-shadow: 0 0 0 2px var(--sand-gold-hi), 0 0 12px rgba(230, 169, 76, 0.5);
  }
}


:where(:root[data-layout="mobile"]) {

  /* 目标面板 · 三行: [Round+玩家+倒计时] / [金额|彩蛋 标签+数值] / [双汇合条] */
  .focus-bar {
    padding: 5px 14px 4px;   /* 顶部留一点呼吸, 倒计时不贴边 */
    gap: 0;
    border-radius: var(--r-lg);
  }
  /* 倒计时收小: 原 42-56 太占版面(用户反馈费劲) → 32-44, 给商品区让出竖向空间 */
  .focus-bar .countdown-display { font-size: clamp(31px, 8.4vw, 40px); font-weight: 1000; }
  /* 倒计时与目标行之间收紧: 不再按幽灵大字高度撑 60-84px。 */
  .focus-bar:not([data-mode='endless']) .countdown-display { line-height: 1.02; margin: 2px auto -2px; }
  /* 幽灵数字装饰化 · 与倒计时同字号同行高同 top, 完美对齐倒计时数字的垂直中心
     2026-09-03 fix: 原 top:1px + transform:none 让幽灵字贴 focus-bar 顶,
     与倒计时中心错位 ~5px (用户反馈高度不齐);
     现在字号 = 倒计时字号 clamp(31px, 8.4vw, 40px) · line-height = 1.02 · top = padding-top
     幽灵字成为倒计时的同位置同形投影, 只保留色彩/透明度差。 */
  .focus-bar::before {
    font-size: clamp(31px, 8.4vw, 40px);
    line-height: 1.02;
    top: 5px;                             /* 与 focus-bar padding-top 一致 */
    right: 0;
    transform: none;
    opacity: 0.6;
  }
  .focus-converge { margin-top: 1px; }
  .focus-converge__track { height: 10px; }

  /* 底部操作栏 · 投骰+结算两按钮再缩一档 (2026-09-03 用户: 仅手机端再缩小, 现在有点大)。
     高度 44→38 + 字号 14→12, 降低手机端底栏占高, 商品区可见更多。保持可点(38px 触控下限)。
     2026-09-04: 用户反馈结算按钮偏小——二轮确认方案: 骰子保持原长条 (flex:1 占满中段),
     两按钮等高, 结算只加长 (padding 12→20px) 不再垫高, 同行视觉齐平不局促。
     2026-09-04 三轮: 用户反馈底栏整行偏高占商品区——38→34px, 触控仍 ≥34px 可点。 */
  .checkout-bar { gap: 6px; padding: 0 2px; }
  .checkout-bar .dice-button {
    min-height: 34px;        /* 44→38→34: 再压缩底栏高度, 让出空间给商品卡 */
    min-width: 0;
    /* 2026-09-06: 底栏宽度按 3:1 分配 —— 投骰 3 份(主操作), 结算 1 份。 */
    flex: 5 1 0; /* 投骰 5/8 */
    max-width: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    padding: 0 10px;
  }
  .checkout-cta {
    flex: 3 1 0; /* 结算 3/8 */             /* 2026-09-06: 结算占 3/8 宽 (投骰 5/8) */
    min-width: 0;
  }
  .checkout-cta .primary-button.compact {
    min-height: 34px;        /* 与骰子等高 34px, 同行齐平 */
    padding: 0 20px;
    font-size: 12px;
    font-weight: 800;
    width: 100%;             /* 填满 1/4 容器 */
  }
  /* 骰子按钮内部元素随按钮缩小同步收: 图标 28→22, 剩余次数/冷却小字 14→11
     2026-09-04: 骰子资产放大 22→28 (按钮 38px 高, 28px 图标占 74%, 视觉更饱满;
     骰子是核心交互, 图标应最大化突出, X/Y/冷却小字保持 11px 不变) */
  /* 骰子图标随按钮 38→34 同步收一档 (28→26), 保持与按钮高度配比 */
  .checkout-bar .dice-button .dice-icon { font-size: 26px; }
  .checkout-bar .dice-button .dice-remaining,
  .checkout-bar .dice-button .dice-cooldown { font-size: 11px; margin-left: 2px; }

  /* 顶部双目标收束 (P0-2) · 金额数字长(亿级)与彩蛋 overlap 真根因:
     .focus-goal 是内层 grid, 隐式列 auto(max-content) → value 宽随内容长到撑破外层 minmax(0,1fr) 单元,
     value 自身 overflow:hidden 因盒子=内容宽而永不触发 → 溢出压到右列。
     修法: 给 .focus-goal 显式 minmax(0,1fr) 列 + value width:100% 填满有界列, ellipsis 才真正生效。
     并按用户要求缩小金额字号(进度条才是最重要的, 数字超长省略可接受)。 */
  .focus-goals { gap: var(--s-2); margin-top: -1px; }          /* 与倒计时贴近, 仍双列 */
  .focus-goal { grid-template-columns: minmax(0, 1fr); gap: 1px; } /* 内层列有界, 让 value 能被约束 */
  .focus-goal__label { font-size: clamp(11px, 3vw, 13px); }    /* 标签缩一档 */
  .focus-goal__value {
    font-size: clamp(10px, 2.8vw, 13px);                      /* 金额缩小(用户要求): 16→13 上限 */
    width: 100%;                                               /* 填满有界列, 普通模式长目标才触发 ellipsis */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;                                  /* 普通模式超长省略, 不再 overlap 右列 */
  }
  .focus-bar[data-mode='endless'] .focus-goal--left .focus-goal__value {
    width: auto;
    overflow: visible;
    text-overflow: clip;
  }

  /* ── 无尽模式手机端收束: PC 端放大档全部收回普通档, 顶部整体高度对齐普通玩法 ── */
  /* .wealth-hud--pk 手机端恢复 PC 的右对齐 · 抵消 wealth-hud.css:200 mobile 通用
     .wealth-hud{align-items:baseline;padding:6px 14px} 的波及, 特异性 (0,2,0) > (0,1,0) */
  .focus-bar[data-mode='endless'] .wealth-hud--pk {
    align-items: flex-end;
    padding: 0;
    gap: 4px;
  }
  /* 倒计时: PC 端无尽是 clamp(72px,20vw,120px), 手机端收回普通档 32-44px (与普通模式对齐) */
  .focus-bar[data-mode='endless'] .countdown-display {
    font-size: clamp(32px, 9vw, 44px);
  }
  /* 左右财富数字: PC 端无尽是大字档, 手机端收回并允许完整千分位数字横向自适应。 */
  .focus-bar[data-mode='endless'] .focus-goal--left .focus-goal__value,
  .focus-bar[data-mode='endless'] .wealth-hud--pk .wealth-hud__number {
    font-size: clamp(11px, 3.1vw, 15px);
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    letter-spacing: -0.06em;
  }
  /* 右侧"砂金实时财富"标签: PC 端被放大到 clamp(15px,4.2vw,18px), 手机端收回 11-13px (比左标签略小, 7个字长避免拥挤) */
  .focus-bar[data-mode='endless'] .wealth-hud--pk .wealth-hud__label {
    font-size: clamp(11px, 3vw, 13px);
  }
  /* 手机端右侧数字藏"信用点"单位 —— 左侧累积花费本就不带单位, 对齐且省横向空间 */
  .focus-bar[data-mode='endless'] .wealth-hud--pk .wealth-hud__unit { display: none; }

  /* 2026-09-03 红点位置: 砂金实时资产的 pulse-dot 红点原随标签挤在倒计时 bar 中间(挤巴),
     移到倒计时 bar 右侧——右列右上缘, 不再压右侧金额。右列变 relative 锚点,
     标签加右 padding 容纳红点, 避免挤压换行。 */
  .focus-bar[data-mode='endless'] .focus-goal--right { position: relative; }
  .focus-bar[data-mode='endless'] .wealth-hud--pk .wealth-hud__label {
    padding-right: 14px;    /* 给右上角红点让位, 标签文字不折行 */
  }
  .focus-bar[data-mode='endless'] .wealth-hud--pk .wealth-hud__label .pulse-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    margin: 0;
  }

}


/* iPad 横屏短视口：单屏禁滚, 目标 bar / 骰子进一步收拢, 给商品卡留可视区。 */

@media (orientation: landscape) and (max-height: 1024px) {
:where(:root[data-layout="tablet"]) {

  .focus-bar {
    padding: 10px var(--s-5);
    gap: var(--s-1);
    border-radius: var(--r-lg);
  }
  .focus-bar .countdown-display { font-size: clamp(40px, 6vw, 60px); }
  .focus-converge__track { height: 6px; }
  .dice-button { min-height: 44px; font-size: var(--fs-md); }

  /* 矮屏等比压缩 · 消除 shop 内部滚动(温保留白): challenge-root 间距/padding 收,
     grid gap 收, 卡片 padding 温和收(16+4→12 保留呼吸), 图区高度随 vh 收。
     padding/gap 不降到 8 以下, 保持留白质感。 */
  .challenge-root { gap: 10px; padding-block: 12px; }
  .item-grid { gap: 10px; }
  .item-card { padding-block: 12px; }
  .focus-goal__value { font-size: 18px; }
  .focus-goal__label { font-size: 15px; }
  /* 图区高度按矮屏收紧: 1366×1024 下 ~169→~133, 两行卡让出 ~72px */
  .item-image-slot { height: clamp(120px, 13vh, 200px); }

}
}


/* ─── 轮次 intro：轮次时间线 + 目标 todo list ─── */
.intro-dialog {
  /* 宽度与晋升弹窗 (round-end) 拉齐 */
  width: min(calc(100% - 32px), 480px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-5) var(--s-4);
  background: var(--c-bg-elevated);
  box-shadow: 0 32px 80px rgba(31, 26, 15, 0.36), 0 0 0 3px rgba(201,168,76,0.5);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.intro-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.intro-dialog form { margin: 0; }

/* Round 0 完成 finale 标题: 金色大字, 居中于时间线上方 */
.intro-finale-title {
  margin: 0 0 var(--s-3);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 4vw, 32px);
  background: linear-gradient(135deg, #fff 0%, #F0C878 60%, #E6A94C 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(232, 204, 122, 0.4));
}
.intro-dialog.is-in .intro-finale-title:not([hidden]) {
  animation: intro-task-in 0.55s var(--ease-out) forwards;
}
.intro-dialog[open] {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.intro-dialog.is-in { opacity: 1; transform: scale(1); }

/* ── 顶部轮次时间线 · 只留数字 1/2/3 ── */
.intro-tl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-6);   /* 顶部留空给 Round 标签 */
}
.intro-tl__step {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  border: 2px solid #DCD2BA;
  background: #F4EEDD;
  color: #B8AE94;
  opacity: 0;
  transform: translateY(-8px);
  white-space: nowrap;
}
.intro-tl__step.is-done {          /* 已过轮: 金色描边金字, 收敛不放大 */
  border-color: var(--c-gold);
  background: radial-gradient(circle at 50% 45%, #FFF7E3, #F6E6BE);
  color: var(--c-gold-dark);
}
/* 当前轮: "Round X" 取代数字, 椭圆胶囊放大 + 金光呼吸 */
.intro-tl__step.is-active {
  flex: 0 0 auto;
  width: auto;
  min-width: 116px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--c-gold);
  background: radial-gradient(circle at 50% 40%, #FFF6DE, #FBEDC6);
  color: var(--c-gold-dark);
  font-size: 17px;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 8px rgba(230, 169, 76, 0.25);
}
.intro-tl__line {
  flex: 0 0 26px;
  height: 2px;
  border-radius: 2px;
  background: #E2D9C2;
  position: relative;
  overflow: hidden;
}
/* 入场: step 逐个下滑淡入 · 加 .is-in 触发 (连接横杆保持静态, 不做流水动画) */
.intro-dialog.is-in .intro-tl__step {
  animation: intro-step-in 0.5s var(--ease-out) forwards;
}
.intro-dialog.is-in .intro-tl__step:nth-of-type(1) { animation-delay: 0.12s; }
.intro-dialog.is-in .intro-tl__step:nth-of-type(3) { animation-delay: 0.26s; }
.intro-dialog.is-in .intro-tl__step:nth-of-type(5) { animation-delay: 0.40s; }
.intro-dialog.is-in .intro-tl__step.is-active {
  animation: intro-step-in 0.5s var(--ease-out) forwards, intro-tl-glow 2.2s ease-in-out 0.6s infinite;
}
@keyframes intro-step-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes intro-tl-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(230,169,76,0.25), 0 0 0 4px rgba(230,169,76,0.18); }
  50%      { box-shadow: 0 2px 12px rgba(230,169,76,0.4),  0 0 0 7px rgba(230,169,76,0.1); }
}

/* ── 目标 todo list · 左侧标签作为大号灰色背景字 / 右侧真实目标保持视觉焦点 ── */
.intro-tasks {
  list-style: none;
  margin: 0 0 var(--s-5);
  padding: 0;
}
.intro-task {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-4);
  min-height: 72px;
  padding: var(--s-3) 2px;
  border-bottom: 1px solid rgba(184, 123, 38, 0.12);
  opacity: 0;
  transform: translateY(12px);
  /* overflow:hidden 移除: 背景大字改绝对定位装饰层 (见 .intro-task__title),
     不再需要裁剪; 裁剪反而会在 iPhone SE 等窄屏把露头的数值切掉 */
}
.intro-task:last-child { border-bottom: 0; }
/* label · 大号粗体灰字 · 纯背景装饰层 (2026-09 修重叠)
   旧方案: 占 grid 左列+ellipsis, EN "SPENDING GOAL" 宽词折行后与右侧数值穿插,
   iPhone SE 更严重。新方案: 绝对定位退到行底左上, 不占文档流 → 与数值零重叠可能。
   13% 透明度 + 数值深色实心, 装饰层与信息层分明。 */
.intro-task__title {
  position: absolute;
  left: 0;
  /* 2026-09-03 fix: 与右侧数字同高对齐 (用户反馈灰字与黑字高度不齐)
     原 bottom:4px 让装饰字贴底, 数字 baseline 居中 → 垂直错位。
     改为 top:50% + translateY(-50%) 相对 intro-task 垂直居中,
     与右侧数字 (intro-task align-items:center 已居中) 中心线重合。 */
  top: 50%;
  transform: translateY(-50%);
  bottom: auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-weight: 900;
  /* 2026-09-05: EN "FIND HIDDEN ITEMS" 尾部压到右侧数值, 整体缩一档 (34→26) */
  font-size: clamp(18px, 3.8vw, 26px);
  letter-spacing: -0.045em;
  color: rgba(31, 26, 15, 0.13);
  /* 0.86 会裁 CJK 表意盒底部描影 (字盒≈1.12em); 1.12 收进完整字形 */
  line-height: 1.12;
  white-space: nowrap;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 0;
}
/* 数字 · 大字 · 实心黑 · 视觉焦点 (44px, font-display 900) */
.intro-task__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 3.6vw, 34px);
  color: var(--c-ink);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  justify-self: end;
  gap: 2px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
/* 单位 (秒/亿/信用点/斜杠) · 比数字小一档, 暗金 */
.intro-task__num i {
  font-style: normal;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-gold-dark);
  margin-left: 2px;
  letter-spacing: 0;
}
.intro-task__num [data-i-amount] + i {
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
}
.intro-dialog.is-in .intro-task {
  animation: intro-task-in 0.55s var(--ease-out) forwards;
}
.intro-dialog.is-in .intro-task:nth-child(1) { animation-delay: 0.50s; }
.intro-dialog.is-in .intro-task:nth-child(2) { animation-delay: 0.64s; }
.intro-dialog.is-in .intro-task:nth-child(3) { animation-delay: 0.78s; }
@keyframes intro-task-in { to { opacity: 1; transform: translateY(0); } }

/* 开始挑战 · 深墨胶囊 (呼应 hero-pill) · 居中 */
.intro-start {
  display: block;
  margin: 0 auto;
  min-width: 168px;
  min-height: 46px;
  padding: 0 32px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--c-ink-deep);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 220ms var(--ease-out), transform 160ms var(--ease-out);
}
.intro-start:hover { background: var(--ink-hi); }
.intro-start:active { transform: scale(0.97); }

/* ── Mobile · 局间 intro 收束 (P1-3) ─────────────────────────────
   根因: 标题字号 clamp(29px,8vw,38px) 过大 + 标签占 1fr 数值 auto + num nowrap,
   长值(大金额/多位)会吃标签空间或撞弹窗边框。手机端降字号 + 统一行高 + 防溢出。 */
:where(:root[data-layout="mobile"]) {
  .intro-tasks { margin-block: var(--s-3) var(--s-4); }
  .intro-task {
    grid-template-columns: minmax(0, 1fr) auto;   /* 保持, 但下方收紧 */
    min-height: 56px;                             /* 三行等高, 不再被大字撑开 */
    padding: 10px 2px;
    gap: var(--s-2);
  }
  /* 标题(背景大字)装饰层: 2026-09-03 fix 幽灵字对齐 · 用户反馈幽灵字与右侧黑字高度不齐
     原方案 bottom:3px 让灰字贴底, 与右侧 baseline 对齐的数字垂直错位明显。
     新方案: 灰字与数字同 line-height 同 vertical-align, 中心线重合。
     top:50% + translateY(-50%) 相对 intro-task 容器垂直居中; intro-task align-items:center
     让数字也居中 → 两者中心一致。 */
  .intro-task__title {
    /* 2026-09-05: 与桌面档同步缩一档, 防 EN 长文案压数值 */
    font-size: clamp(15px, 4.2vw, 20px);
    line-height: 1.12;
    bottom: auto;                 /* 弃用贴底 */
    top: 50%;
    transform: translateY(-50%);
  }
  /* 数值 · 放大为视觉焦点 (修用户反馈: 数字部分加大, 一眼抓住目标)
     不裁剪: 完整显示 "12 亿 信用点" 等长值 (修 1)
     移除 overflow/text-overflow/max-width: grid auto 列按内容撑开, 数值必须完整可见 */
  .intro-task__num {
    font-size: clamp(24px, 6.2vw, 30px);           /* 右侧数值收敛: 旧 30-38 偏大撞框, 降到 24-30 更规整 */
    min-width: 0;
  }
  .intro-task__num i { font-size: 0.5em; }        /* 单位相对缩小, 数字更突出 */
  .intro-start { min-width: 148px; min-height: 44px; font-size: 14px; }
}

/* PRD § 6.11: 阿哈(H6)全屏金色闪光 2 秒 · 不锁操作 */
.aha-flash {
  position: fixed;
  inset: 0;
  z-index: var(--z-dialog-fx);
  pointer-events: none;
  background: radial-gradient(circle at 50% 46%,
    rgba(255, 233, 170, 0.95) 0%,
    rgba(232, 204, 122, 0.7) 30%,
    rgba(184, 123, 38, 0.25) 60%,
    transparent 78%);
  opacity: 0;
  will-change: opacity, transform;
  animation: aha-flash-anim 2000ms var(--ease-out) both;
}
@keyframes aha-flash-anim {
  0%   { opacity: 0;   transform: scale(0.6); }
  10%  { opacity: 0.8; transform: scale(0.85); }   /* 0.2s: 0 → 0.8 */
  100% { opacity: 0;   transform: scale(1.5); }    /* 0.8s→2.0s: 0.8 → 0 + radial 扩散 */
}
@media (prefers-reduced-motion: reduce) {
  .aha-flash { display: none; }
}

/* MAX OUT 高潮演出: 金句全屏闪现 (余额花光瞬间) */
.maxout-fanfare {
  position: fixed;
  inset: 0;
  z-index: var(--z-fanfare);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%,
    rgba(255, 233, 170, 0.92) 0%,
    rgba(232, 204, 122, 0.55) 36%,
    transparent 72%);
  opacity: 0;
  will-change: opacity, transform;
  animation: maxout-fanfare-anim 1600ms var(--ease-out) both;
}
.maxout-fanfare__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 7vw, 64px);
  font-weight: 900;
  color: var(--gold-deep, #8a5a1a);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6), 0 0 24px rgba(255, 200, 80, 0.9);
  letter-spacing: 0.04em;
  transform: scale(0.7);
  animation: maxout-title-anim 1600ms var(--ease-out) both;
}
.maxout-fanfare__quote {
  /* 台词是中文, 与 .unlock-quote 同理不用 Harshita(只覆盖英文), 走 --font-display + italic 金棕 */
  font-family: var(--font-display);
  font-size: clamp(16px, 3.5vw, 24px);
  color: rgba(90, 50, 10, 0.85);
  opacity: 0;
  animation: maxout-quote-anim 1600ms var(--ease-out) 200ms both;
}
@keyframes maxout-fanfare-anim {
  0%   { opacity: 0; transform: scale(0.85); }
  18%  { opacity: 1; transform: scale(1); }
  72%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}
@keyframes maxout-title-anim {
  0%   { transform: scale(0.7); }
  24%  { transform: scale(1.12); }
  40%  { transform: scale(1); }
  100% { transform: scale(1.04); }
}
@keyframes maxout-quote-anim {
  0%   { opacity: 0; transform: translateY(8px); }
  30%  { opacity: 1; transform: translateY(0); }
  78%  { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .maxout-fanfare { display: none; }
}
/* reduced-motion 降级: 解锁 Modal 标题 800ms 金色 pulse */
.is-aha-pulse { animation: aha-title-pulse 800ms ease-in-out; }
@keyframes aha-title-pulse {
  0%, 100% { color: inherit; }
  50%      { color: var(--c-gold-dark); text-shadow: 0 0 12px rgba(232, 204, 122, 0.7); }
}

/* ─── iPad portrait 弹窗节奏 ─────────────────────────────────
   弹窗不用手机的窄 360/400px 盒子,也不盲目撑满 iPad;适度放宽并增加留白。 */

@media (orientation: portrait) {
:where(:root[data-layout="tablet"]) {

  .intro-dialog {
    width: min(calc(100% - 96px), 560px);   /* 与晋升弹窗拉齐 */
    padding: var(--s-7) var(--s-6) var(--s-6);
  }
  .intro-task { padding-block: 20px; }

  .round-end-dialog {
    width: min(calc(100% - 96px), 560px);
    padding: var(--s-5) var(--s-6);
  }
  .round-end-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    min-height: 240px;
    gap: var(--s-4);
  }
  .round-end-hero h2 { font-size: clamp(24px, 3.8vw, 34px); }
  .round-end-emote {
    min-height: 220px;
    max-height: 260px;
  }

  /* unlock 破框保留; 宽度与晋升弹窗拉齐, 美术仍 200px 不放大避免视觉过量 */
  .unlock-dialog { width: min(calc(100% - 96px), 560px); }
  .unlock-body { padding-inline: var(--s-6); }

  /* iPad 竖屏商品网格: 2×3 为主要视图。行按 shop 可用高平分撑满(1fr)保底 230,
     高视口填满红框无下方空白;矮视口取 230 保底 + 轻量滚动 (与 PC 统一撑满逻辑)。 */
  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(230px, 1fr);
  }
  .item-card { grid-template-rows: 48% 1fr auto; }
  .item-card .item-image-slot { height: auto; }

}
}


/* intro reduced-motion 降级: 直接显示终态, 关闭所有入场/循环动画 */
@media (prefers-reduced-motion: reduce) {
  .intro-dialog[open] { opacity: 1; transform: none; transition: none; }
  .intro-tl__step,
  .intro-task { opacity: 1; transform: none; }
  .intro-dialog.is-in .intro-tl__step,
  .intro-dialog.is-in .intro-tl__step.is-active,
  .intro-dialog.is-in .intro-task { animation: none; }
}

/* ── 无尽 PK / 倒计时水印 新增动画的 reduced-motion 兜底 ── */
@media (prefers-reduced-motion: reduce) {
  /* 倒计时 danger 态脉冲关停, 实心红已足够警示 */
  .focus-bar[data-mode='endless'] .countdown-display[data-phase='danger'] { animation: none; }
}

/* ═══ Round 0 教学态 · 真实操作提示 + 固定目标 ═══ */
.challenge-root[data-mode='tutorial'] #diceRemaining,
.challenge-root[data-mode='tutorial'] #diceCooldown {
  display: none !important;
}
.challenge-root[data-mode='tutorial'] #diceButton:disabled {
  opacity: 0.45;
}
.challenge-root[data-mode='tutorial'] .stage-name {
  background: var(--c-ink-deep);
  color: var(--c-ink-on-dark);
}
.challenge-root[data-mode='tutorial'] .checkout-cta .primary-button.compact:not(:disabled) {
  background: var(--grad-cta);
  color: var(--c-ink-deep);
  box-shadow: var(--shadow-gold);
}
.item-card[data-card-buy='true'] {
  cursor: pointer;
  /* 双击缩放复活点 → manipulation (与 app-shell-guard 一致)。pan-y 允许浏览器用纵向手势
     判定为"可能要缩放/滚动", manipulation 保留平移+点击, 额外禁双击/双指缩放。 */
  touch-action: manipulation;
}
.item-card[data-card-buy='true']:active {
  translate: 0 1px;
}
/* 触屏端禁用整卡几何位移：sticky hover 与 :active 交替会让小字号标题在 220ms 过渡中重栅格化，
   视觉上表现为购买瞬间重影/跳动。桌面精确指针仍保留 hover 上浮与 active 下压。 */
@media (hover: none), (pointer: coarse) {
  .item-card[data-card-buy='true']:hover,
  .item-card[data-card-buy='true']:active {
    translate: none;
  }
}
/* card-buy 步进器 · 展开态减/加钮 36px (2026-09-04 用户反馈: PC 端步进器局促 → 按钮/数字/间距整体放大)。
   PC/iPad, 手机端整组隐藏见 styles.css mobile .item-actions。
   不设 min-width: flex 容器内 min-width:auto 会兜底内容宽度, 顶住上方折叠态的 max-width:0。 */
.item-card[data-card-buy='true'] .qty-btn:not([data-role='plus']) {
  width: 36px;
  height: 36px;
  font-size: 17px;
}
/* 展开态(买过>0) + 钮也回 36px 普钮 (count=0 金钮走上方 32px 规则, 尺寸一致无需覆盖)。
   同样不设 min-width, 见上方减钮注释。 */
.item-card[data-card-buy='true']:not([data-count='0']) .qty-btn[data-role='plus'] {
  width: 36px;
  height: 36px;
  font-size: 17px;
}
/* 展开态数字: 最小宽度恢复(折叠态的 min-width:0 会压到内容最小), 字号放大、按钮间距拉开 */
.item-card[data-card-buy='true']:not([data-count='0']) .qty-count {
  min-width: 22px;
  font-size: 15px;
}
.item-card[data-card-buy='true']:not([data-count='0']) .item-actions {
  gap: 6px;
  padding: 3px;
}
:where(:root[data-layout='mobile']) .item-card[data-card-buy='true'] .price {
  font-size: clamp(14px, 4vw, 16px);   /* 与 styles.css 全量数字档同步放大 (2026-09-04 用户反馈: 金额识别度差) */
  letter-spacing: -0.01em;
}
/* ═══════════════════════════════════════════════════════════
   PC(desktop) 默认留白档 · 无条件(高屏 1920×1080 等的默认观感):
   逼近浏览器缩放 67% 的宽舒畅观感。区域占比对齐 67% 目标(shop≈63% / focus≈15% /
   top≈6% / checkout≈4%)——压 top/focus/checkout 让出空间给 shop, 卡片才有余量放大美术。
   修高屏截断: 图区不固定 height(会顶死内容致 card overflow 截断), 改填满图区行;
   卡片用 1fr 填满 shop + 图区行 minmax(0,1fr) 弹性, 内容自动分布不溢出。
   作为 desktop 默认, 写在矮屏档之前; 矮屏(max-height:1000)在下面覆盖压缩。
   仅 desktop, 不碰 iPad/mobile。晚加载稳赢覆盖 styles.css:1285 的 min-content/safe center。
   ═══════════════════════════════════════════════════════════ */
:where(:root[data-layout="desktop"]) {

  .challenge-root { gap: var(--s-5); padding-block: var(--s-5); }   /* 区域间距 16→24, 留呼吸 padding */
  .challenge-topline .wealth-hud--top { padding-block: 6px; }        /* 压顶栏占比 7→6% */
  .ticker-strip { padding-block: 3px; }
  .focus-bar { padding-block: var(--s-2); gap: 4px; }                /* 压倒计时占比 19→15% */
  .focus-bar .countdown-display { font-size: clamp(48px, 4.4vw, 64px); line-height: 0.9; }
  .focus-goal__value { font-size: clamp(16px, 1.4vw, 19px); }
  .focus-goal__label { font-size: 14px; }
  .checkout-bar { padding-block: 0; }                                /* 压底栏占比 6→4% */
  /* 2026-09-03: PC 底栏放大一档 (用户要求: 仅 PC 放大, 手机保持现状)。
     骰子 44→56 / 结算 44→56, 字号 14→16 与全局 primary-button 一致。
     2026-09-06: 底栏 3:1 分配 —— 投骰 3 份(覆盖 styles.css 1048 的 1 1 360px), 结算 1 份。 */
  .checkout-bar .dice-button {
    min-height: 56px;
    font-size: 16px;
    padding: 0 var(--s-5);
    flex: 5 1 0; /* 投骰 5/8 */
    min-width: 0;
  }
  .checkout-bar .dice-button .dice-icon { font-size: 44px; }
  .checkout-bar .dice-button .dice-remaining,
  .checkout-bar .dice-button .dice-cooldown { font-size: 13px; margin-left: 4px; }
  /* 覆盖 styles.css:1572 桌面无条件段 cta min-height:60, 压到 56 让底栏达标 */
  .checkout-cta {
    flex: 3 1 0; /* 结算 3/8 */
    min-width: 0;
  }
  .checkout-cta .primary-button.compact {
    min-height: 56px;
    padding: 0 var(--s-5);
    font-size: 16px;
    width: 100%;
  }
  /* 关键: 覆盖 styles.css:1294 的 min-content/safe center。
     1fr 填满 shop 高(非按内容堆, 避免 min-content+大padding 溢出), align-content:stretch
     让两行卡平分 shop 高。给图区行留弹性空间, 配合图区 height:100% 填满不截断。 */
  /* 高屏(>1000px)商品区压扁+垂直居中留白: max-height:60vh + margin-block:auto。
     作为 desktop 默认(不用 min-height 媒体查询, 那不在 check-responsive-css 白名单);
     矮屏(max-height:1000)段下面会复位成 none/0 让其填满。行为等价原 min-height:1001 段。 */
  .item-grid { gap: var(--s-4); grid-auto-rows: minmax(0, 1fr); align-content: stretch; max-height: 60vh; margin-block: auto; }
  .item-card {
    padding: var(--s-4) calc(var(--s-4) + 4px);                      /* 卡内留白 16 */
    gap: 6px;
    /* 图区行 minmax(0,1fr) 弹性: 随卡高伸缩, 不固定致内容溢出截断; 文字/价格 auto。 */
    grid-template-rows: minmax(0, 1fr) auto auto;
  }
  /* 图区填满图区行(height:100%), 不固定高度——避免 height 主导时把文字/价格顶出卡片
     可视区造成截断。min-height:0 允许行收缩, object-fit:contain 承自 styles.css 保不变形。 */
  .item-image-slot { height: 100%; aspect-ratio: auto; max-height: 100%; min-height: 0; }
  .item-emoji { font-size: clamp(64px, 5.6vw, 88px); }

}

/* ═══════════════════════════════════════════════════════════
   PC(desktop) 矮屏紧凑 fit 档 · max-height:1000 触发(≤1000px 视口, 含 1440×900 矮笔记本):
   目标: 一屏不滚、不变形, 且区域占比对齐 67% 目标(shop≈63% / focus≈15% / top≈6% /
   checkout≈4%)——矮屏原 top+focus+checkout 占 32% 偏高, 压到 25% 让 shop 从 61→63%+。
   ① grid-auto-rows 给 minmax(160px,1fr) 让卡真能缩而非内容顶死;
   ② 卡片 grid-template-rows 给图区 minmax(0,1fr) 让图区随卡高弹性而非顶文字;
   ③ 图区 height:100% 填满图区行(非固定 vh), 避免矮屏固定高截断或变形;
   ④ top/focus/checkout 再压一档字号+padding, 释放空间给 shop。
   padding/gap 维持 ≥8 保留白质感。仅 desktop, 不碰 iPad/mobile。
   写在末尾(最晚加载), 同特异性后置覆盖前置段, 确保生效。
   ═══════════════════════════════════════════════════════════ */
@media (max-height: 1000px) {
:where(:root[data-layout="desktop"]) {

  /* 矮屏收窄居中: 738628c 只给高屏加了 max-height:60vh 压扁+居中, 矮屏漏做 → 商品铺满全宽且被放大的
     gap 挤矮 → 观感"过扁+贴边"。这里补齐: padding-inline 随宽缩放做左右留白(整块含顶栏一起收窄, 与信息面板对齐),
     gap 16→12 收回被吃掉的卡片高度。实测 1280/1440/1536 卡片比 1.55→1.3~1.5, 左右留白 127~142px, shop 不溢出。 */
  .challenge-root { gap: 10px; padding-block: 8px; padding-inline: clamp(56px, 6vw, 132px); }
  .challenge-topline .wealth-hud--top { padding-block: 4px; }        /* 顶栏占比 8→6% */
  .ticker-strip { padding-block: 2px; }
  .focus-bar { padding-block: 4px; gap: 2px; }                       /* 倒计时占比 17→15% */
  .focus-bar .countdown-display { font-size: clamp(40px, 4.6vw, 52px); line-height: 0.9; }
  .focus-goal__value { font-size: 17px; }
  .focus-goal__label { font-size: 13px; }
  .checkout-bar { padding-block: 0; }                                /* 底栏占比 7→4% */
  /* 2026-09-03: 矮屏 PC 同步放大 (用户要求: 仅 PC 放大, 手机保持现状)。
     骰子 40→48 / 结算 40→48, 字号 sm→md。
     2026-09-06: 与桌面正常屏同步 —— 5:3 分配 (投骰 5 / 结算 3)。 */
  .checkout-bar .dice-button { min-height: 48px; font-size: var(--fs-md); padding: 0 var(--s-4); flex: 5 1 0; /* 投骰 5/8 */ min-width: 0; }
  .checkout-bar .dice-button .dice-icon { font-size: 40px; }
  .checkout-bar .dice-button .dice-remaining,
  .checkout-bar .dice-button .dice-cooldown { font-size: 12px; margin-left: 3px; }
  /* 覆盖 styles.css:1572 桌面 cta min-height:60, 压到 48 让矮屏底栏达标 */
  .checkout-cta { flex: 3 1 0; /* 结算 3/8 */ min-width: 0; }
  .checkout-cta .primary-button.compact { min-height: 48px; padding: 0 var(--s-4); font-size: var(--fs-md); width: 100%; }
  /* 商品网格在本档刚好填满 shop；基础层的上下 6px 渐隐 mask 会把第一/末行边缘误裁成“卡片被切”。
     矮屏改为 4px 实体安全边距，保留完整商品与救场高亮。 */
  .shop {
    padding-top: 4px;
    padding-bottom: 4px;
    mask-image: none;
    -webkit-mask-image: none;
  }
  /* 关键: 覆盖默认档; 去掉 160px 保底(矮屏真要缩, 保底会顶死内容致底部截断),
     复位默认档的 60vh 压扁(矮屏要填满, 不居中留白) */
  .item-grid { gap: 12px; grid-auto-rows: minmax(0, 1fr); max-height: none; margin-block: 0; }
  /* 关键: 图区行 minmax(0,1fr), 图区随卡高弹性, 不顶死文字行;
     padding 12→10 微收(矮屏纵向紧张, 让出空间保卡片完整不截断), gap 6 保呼吸 */
  .item-card { padding: 10px 12px; gap: 6px; grid-template-rows: minmax(0, 1fr) auto auto; }
  /* 矮屏商品文字稍大, 缩字: 标题/副标题各降一档, 价格保持可读 */
  .item-title { font-size: clamp(13px, 1.5vw, 16px); }
  .item-meta  { font-size: var(--fs-2xs); }
  .price      { font-size: clamp(16px, 1.9vw, 20px); }   /* 15→16 下限回调, Space Mono 字面窄可容 */
  /* 关键: 图区填满图区行, 矮屏随卡收缩, 不固定高避免截断/变形 */
  .item-image-slot { height: 100%; aspect-ratio: auto; max-height: 100%; min-height: 0; }

}
}

/* ═══════════════════════════════════════════════════════════
   手机/平板横屏矮屏 (landscape + max-height:600px) · 2026-09 修图4/图5 爆框:
   667×375 (mobile) / 844×390 (沙箱触屏=tablet 误报) 级视口下
   顶部 (HUD+ticker+focus) 占 ~200px, 商品区仅剩 ~150px,
   普通模式 min-height:232 卡片被裁、MAX OUT 2×2 图区塌陷。
   策略: 顶部装饰带隐藏 + 倒计时压缩 + 卡高兜底 + 图区弹性。
   判定走 max-height (非 data-layout): 手机横屏/平板横屏/矮屏桌面都中招, 共性是纵向空间不足。
   ═══════════════════════════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 600px) {
:where(:root[data-layout="mobile"], :root[data-layout="tablet"]) {

  /* ① 顶部装饰带隐藏, 腾 ~80px 给商品区 (横屏首要矛盾是纵向空间) */
  .challenge-topline .wealth-hud--top { padding-block: 2px; }
  .ticker-strip { display: none; }

  /* ② challenge-root 保持 height:100dvh+overflow:hidden (顶/底栏固定),
     商品区 .shop 已有 overflow-y:auto, flex 收缩后内部滚动兜底 —— 不动根容器,
     只收紧 gap/padding 给 shop 让出纵向空间 */
  .challenge-root {
    gap: 4px;
    padding-block: 4px calc(var(--s-2) + env(safe-area-inset-bottom, 0px));
  }
  .shop { min-height: 220px; }   /* 横屏兜底: flex 收缩后至少留两行卡的可视高 */

  /* ③ 倒计时再压一档: 横屏 31-40px → 24-32px */
  .focus-bar { padding: 4px 10px 3px; }
  .focus-bar .countdown-display { font-size: clamp(24px, 5vw, 32px); }
  .focus-bar[data-mode='endless'] .countdown-display { font-size: clamp(22px, 4.6vw, 30px); }
  .focus-converge__track { height: 6px; }
  .focus-goal__label { font-size: 10px; }
  .focus-goal__value { font-size: clamp(9px, 2.4vw, 12px); }

  /* ④ 底栏操作按钮收一档 */
  .checkout-bar .dice-button,
  .checkout-cta .primary-button.compact { min-height: 38px; }

  /* ⑤ 普通模式卡高: min-height 200→0 去掉兜底 (任务2: align-self:start 内容驱动后不再需要) */
  .item-card { min-height: 0; }
  .item-image-slot { aspect-ratio: 21 / 10; }   /* 16:10 → 21:10 更扁, 腾纵向给文字/价格 */

  /* ⑥ MAX OUT 2×2: 横屏矮屏改 4 列单行 (tablet 横屏基础已是 4×1, mobile 基础 2×2 在 390 高
     会被压扁), 图区弹性, 卡高按 vh 兜底。普通模式不动 (2 列滚动 OK)。 */
  #challengeRoot[data-mode="endless"] .item-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    grid-auto-rows: minmax(0, auto);
    gap: 8px;
    padding-inline: 12px;
  }
  #challengeRoot[data-mode="endless"] .item-card {
    min-height: min(150px, 44dvh);   /* 390px 高 → 150; 更矮屏等比缩, 不顶死 */
    padding: 8px;
    gap: 4px;
    grid-template-rows: minmax(0, 1fr) auto auto;
  }
  #challengeRoot[data-mode="endless"] .item-image-slot {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    aspect-ratio: auto;              /* 解锁 16/9, 让图区随卡高弹性收缩 */
  }
  #challengeRoot[data-mode="endless"] .item-title { font-size: clamp(10px, 2.6vw, 12px); -webkit-line-clamp: 2; }
  #challengeRoot[data-mode="endless"] .price { font-size: clamp(11px, 2.8vw, 13px); }

}
}

/* ===== css/wealth-hud.css ===== */
/* 砂金财富 HUD · 极简一行 · 手账贴纸风
   两个变体:
   - .wealth-hud--top     挑战区顶栏 sticky, 横向 flex, 桌面主用
   - .wealth-hud--marquee 移动端极窄降级 (Phase 2 不做, 预留)
*/

.wealth-hud {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  padding: 14px 22px;
  border-radius: var(--r-lg);
  /* 减重投影 · paper-elevated 实底 + 细描边 · 对齐首页克制语言 */
  background: var(--paper-elevated);
  box-shadow: var(--shadow-hairline);
  position: relative;
  overflow: hidden;
}

.wealth-hud__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  /* 白底上 --c-gold-dark(#E39A2E) 对比度仅 ~2.4:1, 细 mono 字看不清 (用户反馈日文 label 几乎不可见)。
     改暖墨 --ink-soft(#57503F, 对比度 ~7:1) 保可读; 金色品牌感由左侧 pulse-dot 与下方大数字承担。
     字体体系收敛 (2026-09): 标签是「角色称号口吻」, 走 quote 衬线 (Forum / Noto Serif SC / Shippori Mincho)。 */
  color: var(--ink-soft);
  font-family: var(--font-quote);
  font-size: 13px;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--house-red);
  box-shadow: 0 0 0 0 var(--house-red);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.55); transform: scale(1); }
  70%  { box-shadow: 0 0 0 10px rgba(230, 57, 70, 0); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);    transform: scale(1); }
}

.wealth-hud__number {
  font-family: var(--font-numeric);   /* 功能数字统一 Space Mono (票据感), 三语言一致 */
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -0.02em;
  background: var(--grad-text-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  transition: filter 200ms ease;
  min-width: 0;
  flex-shrink: 1;
}
.wealth-hud__unit {
  /* 单位统一黑体 (2026-09): EN "Credits" 不再随数字走等宽 Space Mono,
     三语言全走 --font-body (EN Arial / ZH Noto Sans SC / JA Noto Sans JP), 与整体黑体语言一致。
     数字 (--font-numeric) 与单位各司其职、字重同为 700 视觉更稳。 */
  font-family: var(--font-body);
  font-size: 0.42em;
  font-weight: 700;
  margin-left: 8px;
  color: var(--c-ink-soft);
  -webkit-text-fill-color: currentColor;
  letter-spacing: 0.04em;
}

.wealth-hud__delta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-gold-dark);
  white-space: nowrap;
  flex-shrink: 0;
}
.wealth-hud__delta b {
  color: var(--c-ink-deep);
  font-weight: 700;
}

/* 花钱时的微弹跳 + 数字瞬亮 */
/* 玩家花钱 → 只有数字跳动 (bar 包框保持稳定不抖) */
.wealth-hud.is-bumped .wealth-hud__number { animation: hud-bump 420ms var(--easing-bounce); }
.wealth-hud.is-bumped .wealth-hud__number { filter: brightness(1.15); }

/* 单屏禁滚后不再滚动压缩, 直接固定为紧凑态尺寸 (原 .is-compact 规则退役) */
.wealth-hud--top {
  padding: 8px 18px;
}
.wealth-hud--top .wealth-hud__number {
  font-size: clamp(20px, 3.4vw, 34px);
}
.wealth-hud--top .wealth-hud__label {
  font-size: var(--fs-3xs);
}
.wealth-hud--top .wealth-hud__delta {
  display: none;   /* 紧凑态隐藏 delta, 腾屏高 */
}

/* ─── 无尽 PK · 顶部财富横条隐藏, 砂金财富数字移到 PK 条右侧 ─── */
.challenge-root[data-mode='endless'] .wealth-hud--top { display: none; }
.wealth-hud--pk {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  width: 100%;      /* 撑满 focus-goal--right 列宽, 内部 flex-end 右对齐才贴白框边 */
}
/* 布局对齐左侧 focus-goal: 标签在上 → 金额在下 (order 换序, 不动 HTML) */
.wealth-hud--pk .wealth-hud__label {
  order: -1;
  font-family: var(--font-quote);   /* PK 模式标签同走 quote 衬线 */
  font-size: clamp(15px, 4.2vw, 18px);   /* 与左侧"累积花费"标签同档 */
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.01em;
  color: var(--c-ink-soft);
}
.wealth-hud--pk .wealth-hud__number {
  order: 0;
  font-size: clamp(24px, 6.4vw, 34px);   /* 与左侧金额等大且突出 (对齐 .focus-goal__value 无尽档) */
  font-weight: 900;
  letter-spacing: -0.02em;
}
@keyframes hud-bump {
  0%   { transform: translateY(0)    scale(1);    }
  35%  { transform: translateY(-4px) scale(1.02); }
  100% { transform: translateY(0)    scale(1);    }
}

/* ─── 挑战区顶栏容器 · 单屏 flex 列里固定不伸缩, 不再 sticky ─── */
.challenge-topline {
  display: grid;
  gap: var(--s-2);
  flex: 0 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
}

/* ─── 顶栏跑马灯 · 极简单行 · PC 版位压缩(字号缩小/padding 收窄) ─── */
.ticker-strip {
  overflow: hidden;
  /* flex 列(challenge-root overflow:hidden 满溢)会压缩无 flex-shrink 的子项, 使 strip 矮于自然高 →
     overflow:hidden 裁掉文字上缘。固定 flex:0 0 auto 保住自然高度 (与 wealth-hud--top 一致)。 */
  flex: 0 0 auto;
  padding: 4px 14px;
  border-radius: var(--r-md);
  background: rgba(31, 26, 15, 0.06);
  color: var(--c-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;             /* 保证 CJK 字上下缘不被 overflow:hidden 裁切 */
  /* 羽化 48px · 滚动文字进出过渡自然, 不硬截断 */
  mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
}
.ticker-strip__track {
  display: inline-flex;
  gap: 40px;
  white-space: nowrap;
  animation: marquee 28s linear infinite;   /* 45s → 28s, 更有节奏感 */
}
.ticker-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ticker-strip__item::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-gold);
  flex-shrink: 0;
}
.ticker-strip__item .amount {
  color: var(--c-gold-bright);   /* 亮金 · 去棕 */
  font-family: var(--font-numeric);   /* 跑马灯金额数字统一 Space Mono */
  font-weight: 700;
}
.ticker-strip__item .amount::before {
  content: '+';
  margin-right: 2px;
  opacity: 0.55;
}
.ticker-strip__item .note {
  color: var(--c-ink-soft);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

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

:where(:root[data-layout="mobile"]) {

  /* 单屏收束 · 移动端 HUD 单行 (标签+数字一行), 跑马灯小字保留 */
  .challenge-topline {
    gap: 4px;
    /* 语言切换器 position:fixed 右上角 (36px+12px边距≈56px宽区); 顶栏整排右缩,
       避免 HUD 数字/跑马灯文字伸到 fixed 地球图标下方被视觉覆盖。 */
    padding-right: 52px;
  }
  .wealth-hud {
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
    padding: 3px 14px;   /* 顶栏财富条上下内边距收紧 6→3, 让位商品区 */
  }
  /* EN label "Aventurine's Live Fortune" 占 206px(flex-shrink:0), 挤压数字只剩 78px → 11位余额截断成 800,0…。
     修法: label 允许收缩换行(非 nowrap 可折 2 行), 数字独占一行宽不被挤压。数字本身不再 ellipsis(完整千分位优先)。 */
  .wealth-hud__label {
    flex-shrink: 1;
    min-width: 0;
    line-height: 1.15;
    letter-spacing: 0.08em;   /* 移动端收紧字距, 标签更易一行放下 */
  }
  .wealth-hud__number {
    font-size: clamp(19px, 5.5vw, 24px);
    letter-spacing: -0.02em;
    flex-shrink: 0;           /* 数字不收缩: 余额完整优先, 让 label 去折行 */
    white-space: nowrap;
  }
  /* 手机端隐藏"信用点/Credits"单位 —— 数字本身已完整优先, 单位文字会顶到右上角语言切换器被遮挡;
     与无尽模式 .wealth-hud--pk 藏单位 (challenge.css) 对齐。 */
  .wealth-hud__unit { display: none; }
  .wealth-hud__delta { display: none; }
  /* 跑马灯移动端保留 · 字号再缩一档 (2026-09-03 用户要求: 缩小 ticker 腾空间给商品图区)
     10→9px, padding-block 3→2, 行高 1.5→1.4 (CJK 9px 在 1.4 行高下上下缘仍不裁切) */
  .ticker-strip { font-size: 9px; padding: 2px 12px; line-height: 1.4; }

}


/* iPad 横屏短视口: 顶栏进一步收拢, 给商品卡留可视区。 */

@media (orientation: landscape) and (max-height: 1024px) {
:where(:root[data-layout="tablet"]) {

  .challenge-topline { gap: var(--s-1); }
  .wealth-hud--top { padding: 6px 16px; }
  .wealth-hud--top .wealth-hud__number { font-size: clamp(20px, 3vw, 28px); }
  .ticker-strip { padding-block: 5px; }

}
}

/* ===== css/combo-heat.css ===== */
/* MAX OUT Heat HUD：×1/×2/×3；满热是一次扫购，不存在常驻 ×5。 */
.combo-heat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}
.combo-heat[hidden] { display: none; }
.combo-heat__bar {
  position: relative;
  flex: 1 1 auto;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(122, 92, 30, 0.18);
}
.combo-heat__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sand-gold), var(--sand-gold-hi));
  transition: width 120ms linear, background 180ms ease;
}
/* MAX OUT 教学 Heat 演示: 分段上涨放缓，完整看清累积与升倍率，而非真实战斗的极速跟手。 */
.combo-heat.is-tutorial-demo .combo-heat__fill {
  transition-duration: 480ms, 180ms;
  transition-timing-function: cubic-bezier(.22, .8, .22, 1), ease;
}
.combo-heat.is-tutorial-demo .combo-heat__mult {
  transition-duration: 360ms, 180ms;
}
.combo-heat[data-mult="3"] .combo-heat__fill {
  background: var(--grad-gold-aqua);
}
.combo-heat__mult {
  flex: 0 0 auto;
  min-width: 2.4em;
  color: var(--c-gold-dark);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: transform 120ms ease, color 180ms ease;
}
.combo-heat[data-mult="2"] .combo-heat__mult { color: var(--sand-gold); }
.combo-heat[data-mult="3"] .combo-heat__mult { color: var(--sand-gold-hi); transform: scale(1.08); }
.combo-heat.is-cooling .combo-heat__fill { opacity: 0.72; }

#combo-fx-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-combo);
  pointer-events: none;
  display: flex;
  flex-direction: column;          /* 多个特效字竖排一列, 不横向排列溢出屏幕 */
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;                 /* 侧向留白, 大字不贴边 */
  overflow: hidden;                /* 极端超长(横屏/超宽字)裁掉, 绝不横向溢出 */
}
/* 单个特效字不折行 + 弹性收缩, 保证在一行内放下 (CART CLEARED! 手机端也不分两行) */
#combo-fx-layer .combo-fx {
  white-space: nowrap;
  flex: 0 1 auto;
  max-width: 100%;
}
/* ─── combo 大字 · MAX OUT 特效档位定稿 (2026-09-05, mockup: tools/maxout-fx-layout-mockup.html) ───
   文字 = Archivo Black (--font-combo), ×N 数字 = Marcellus (--font-combo-num)。
   全部由 #combo-fx-layer 弹性居中 (单个统一中央, 多个自动竖排一列, 不叠同点不乱飞)。
   档位阶梯 (素→炸), 全部暖金/砂金同族, 不引入红色系:
     hit      暖金 #E0A93E 纯色直立微光 (升档小提示, 原 #A86E08 偏暗已调亮)
     combo    金为主→末端一点青蓝渐变 (里程碑 ×10/×25, 砂金 vibe)
     rampage  暖亮金实心 #F2B33D + skewX(-10°) 大斜度 + 入场一次轻顿 (×50 狂热顶点)
     sweep    暖亮金实心 #F2B33D + skewX(-7°) + 三层金光 (CART CLEARED 扫购, 保持现状)
     jackpot  黑字 #14100A + 金色描边 #F2C665 + 整字快速弹出 + 一道扫光, 紧接金卡入场 (6 HIT 全中最高潮)
   已删: gold (GOLD RUSH 金卡出现不再弹字, 金卡直接入场), fever (HEAT FULL 满热不再弹字)。
   Archivo Black/Marcellus 均单字重 400 → 显式 400 + font-synthesis:none, 防 ZH/JA 900 覆盖造成 faux-bold。 */
.combo-fx {
  opacity: 0;
  color: transparent;
  background: var(--grad-text-gold);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-stroke: 1.5px rgba(122, 92, 30, 0.42);
  font-family: var(--font-combo);
  font-size: clamp(40px, 12vw, 92px);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1;
  text-shadow: 0 4px 18px rgba(230, 169, 76, 0.34);
  transform: scale(1.5);
}
.combo-fx__num {
  font-family: var(--font-combo-num);
  font-weight: 400;
  font-synthesis: none;
}
/* 顶点档斜体: skewX 放外层统一斜 (文字+数字一起), 数字再加 font-style:italic 呼应 (Marcellus 无斜体,
   浏览器 oblique 合成即可, 数字是简单字形合成斜度视觉可接受) */
.combo-fx[data-tone="sweep"] {
  font-size: clamp(48px, 15vw, 120px);
  letter-spacing: 0.08em;
  color: #F2B33D;                    /* 纯暖亮金实心, 不镂空 */
  background: none;
  -webkit-text-stroke: 0;
  transform: skewX(-7deg) scale(1.5);
  text-shadow:
    0 0 18px rgba(255, 246, 214, 0.95),
    0 6px 26px rgba(242, 179, 61, 0.85),
    0 10px 44px rgba(230, 169, 76, 0.7);
}
.combo-fx[data-tone="sweep"] .combo-fx__num { font-style: italic; }
.combo-fx[data-tone="sweep"] {
  font-size: clamp(44px, 13vw, 104px);
}
/* RAMPAGE ×50 专属: 同族暖亮金, 比 sweep 更大更斜 (skewX -10°) + 入场一次轻顿, 与 sweep 拉开层级 */
.combo-fx[data-tone="rampage"] {
  font-size: clamp(52px, 16vw, 128px);
  letter-spacing: 0.08em;
  color: #F2B33D;
  background: none;
  -webkit-text-stroke: 0;
  transform: skewX(-10deg) scale(1.7);
  text-shadow:
    0 0 16px rgba(255, 246, 214, 0.95),
    0 6px 24px rgba(242, 179, 61, 0.85),
    0 10px 40px rgba(230, 169, 76, 0.65);
}
.combo-fx[data-tone="rampage"] .combo-fx__num { font-style: italic; }
/* JACKPOT! 专属: 黑字 + 金色描边镂空字 (无背景板), 金光晕 + 扫光走 ::after, 整字快速弹出 */
.combo-fx[data-tone="jackpot"] {
  font-size: clamp(46px, 16vw, 132px);
  letter-spacing: 0.05em;
  color: #14100A;
  background: none;
  -webkit-text-stroke: 2px #F2C665;
  transform: scale(1.9);
  text-shadow:
    0 0 20px rgba(255, 240, 190, 0.9),
    0 6px 26px rgba(242, 198, 101, 0.65);
}
.combo-fx[data-tone="hit"] {
  font-size: clamp(32px, 9vw, 64px);
  /* 暖金纯色 · 直立 · 微光 (升档小提示, 调亮不自发暗) */
  color: #E0A93E;
  background: none;
  -webkit-text-stroke: 0;
  text-shadow: 0 2px 12px rgba(224, 169, 62, 0.4);
}
/* COMBO 里程碑: 金为主、末端一点青蓝 (砂金 vibe 渐变) */
.combo-fx[data-tone="combo"] {
  background: linear-gradient(100deg, #F6D87A 0%, #F2C665 62%, #A8D8C8 82%, #7CC9B9 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(122, 92, 30, 0.4);
  text-shadow: 0 4px 20px rgba(180, 220, 200, 0.28);
}
.combo-fx.is-live { animation: comboPop 900ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
/* 顶点档弹出动画: keyframes 的 transform 会覆盖静态 skewX,
   故 sweep/rampage 用专属 keyframes 把斜度带进每一帧 */
.combo-fx[data-tone="sweep"].is-live { animation-name: comboSkewPop; }
.combo-fx[data-tone="rampage"].is-live { animation: rampagePop 1050ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
.combo-fx[data-tone="jackpot"].is-live { animation: jackpotPop 1500ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
@keyframes comboPop {
  0% { opacity: 0; transform: scale(1.5); }
  18%, 70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.96) translateY(-40px); }
}
@keyframes comboSkewPop {
  0% { opacity: 0; transform: skewX(-7deg) scale(1.5); }
  18%, 70% { opacity: 1; transform: skewX(-7deg) scale(1); }
  100% { opacity: 0; transform: skewX(-7deg) scale(0.96) translateY(-40px); }
}
/* RAMPAGE: 大一号 + skewX(-10°) + 入场一次轻顿 (过冲回弹), 无抖动循环 */
@keyframes rampagePop {
  0%   { opacity: 0; transform: skewX(-10deg) scale(1.7); }
  12%  { opacity: 1; transform: skewX(-10deg) scale(0.96); }
  20%, 72% { transform: skewX(-10deg) scale(1); }
  100% { opacity: 0; transform: skewX(-10deg) scale(0.96) translateY(-26px); }
}
/* JACKPOT: 整字“砰”地弹出 (过冲回弹), 紧凑快速; 扫光在 ::after */
@keyframes jackpotPop {
  0%   { opacity: 0; transform: scale(1.9); filter: brightness(2.4); }
  9%   { opacity: 1; transform: scale(0.94); filter: brightness(1.4); }
  16%  { transform: scale(1.04); }
  23%  { transform: scale(1); filter: brightness(1); }
  78%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02) translateY(-22px); }
}
/* JACKPOT 扫光: 弹出瞬间一道亮白从左到右扫过金字 (整字一次) */
.combo-fx[data-tone="jackpot"]::after {
  content: attr(data-text);
  position: absolute;
  left: 0; right: 0; top: 0;
  pointer-events: none;
  color: transparent;
  -webkit-text-stroke: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.95) 50%, transparent 68%);
  background-size: 280% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  opacity: 0;
}
.combo-fx[data-tone="jackpot"] { position: relative; }
.combo-fx[data-tone="jackpot"].is-live::after { animation: jackpotSweep 550ms ease-out 60ms 1 both; }
@keyframes jackpotSweep {
  0%   { opacity: 0; background-position: 120% 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; background-position: -120% 0; }
}
/* 手机无尽档: combo 渐变档的描边收窄 (hit 暖金纯色、顶点实心金本就无描边, jackpot 自带金描边, 均不参与) */
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="combo"] {
  text-shadow: 0 4px 14px rgba(230, 169, 76, 0.36);
  -webkit-text-stroke-width: 1px;
}
/* hit 档手机端保留微光 (调亮后不再全程无光) */
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="hit"] {
  text-shadow: 0 2px 8px rgba(224, 169, 62, 0.4);
}
/* 顶点档保留金光但按手机端收缩半径 */
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="rampage"],
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="sweep"] {
  text-shadow:
    0 0 12px rgba(255, 246, 214, 0.95),
    0 4px 16px rgba(242, 179, 61, 0.8),
    0 7px 26px rgba(230, 169, 76, 0.6);
}
/* 手机端字号统一收上限: 各档按最长文案实测一行放下不溢出 (CART CLEARED! / RAMPAGE ×50! / JACKPOT!) */
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="jackpot"] {
  font-size: clamp(36px, 9.8vw, 56px);
  letter-spacing: 0.03em;
  -webkit-text-stroke-width: 1.5px;
  text-shadow:
    0 0 12px rgba(255, 240, 190, 0.9),
    0 4px 16px rgba(242, 198, 101, 0.6);
}
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="rampage"] {
  font-size: clamp(30px, 8.6vw, 46px);
  letter-spacing: 0.04em;
}
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="sweep"] {
  font-size: clamp(26px, 7vw, 38px);   /* CART CLEARED! 单行不折行不溢出 (Archivo Black 超宽 + skew 水平位移, 故再收) */
  letter-spacing: 0.03em;
}
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="combo"] {
  font-size: clamp(28px, 8.6vw, 46px);
}
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="hit"] {
  font-size: clamp(24px, 7.5vw, 38px);
}
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx.is-live {
  animation-duration: 560ms;
}
/* jackpot/rampage 专属 keyframes 在手机端也按各自节奏, 不被 560ms 压缩 */
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="jackpot"].is-live {
  animation-duration: 1500ms;
}
:root[data-layout="mobile"] body:has(#challengeRoot[data-mode="endless"]) #combo-fx-layer .combo-fx[data-tone="rampage"].is-live {
  animation-duration: 1050ms;
}

@media (prefers-reduced-motion: reduce) {
  .combo-fx.is-live { animation: comboPopReduce 300ms ease forwards; }
  @keyframes comboPopReduce {
    0%, 100% { opacity: 0; transform: none; }
    30% { opacity: 1; transform: none; }
  }
}

/* ===== css/share-dialog.css ===== */
/* 分享面板样式 · 浅色纸卡, 不做深色 modal */

.share-dialog {
  width: min(calc(100% - 32px), 520px);
  max-height: calc(100vh - 40px);
  border: 0;
  padding: 0;
  border-radius: var(--r-2xl);
  background: var(--c-bg-elevated);
  color: var(--c-ink);
  box-shadow: 0 40px 100px rgba(31, 26, 15, 0.28);
  /* 2026-09-05: 矮屏(可视高 < ~860px)时标题+票据+CTA+社媒总高超出面板, overflow:hidden 会把
     最底一行社媒 icon 直接裁掉(用户反馈"无 padding 截断")。允许滚动兜底 —— 票据宽度本就按
     视口高自适应(见下方各档 --share-rcpt-w), 滚动只兜极端矮屏/横屏的余量, 常规屏不触发。 */
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
}
.share-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.share-dialog__close {
  /* 2026-09-05: 面板改可滚动(overflow-y:auto)后, absolute 定位会随内容滚出视口。
     sticky 只在滚动时生效, 不滚时与原 absolute 视觉一致(右上角 12px)。
     · button 默认 inline-block 不吃 margin-left:auto, 需 display:block 贴右。
     · margin-bottom:-48px 抵消自身 36px 高 + 12px margin-top, 文档流净占位为 0,
       不把下方内容往下推 (极限矮屏 560px 曾因此从刚好装下变成溢出 11px)。 */
  position: sticky;
  display: block;
  top: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  margin: 12px 12px -48px auto;
  border: 0;
  border-radius: 50%;
  background: rgba(31, 26, 15, 0.06);
  color: var(--c-ink-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.share-dialog__close:hover {
  background: rgba(31, 26, 15, 0.12);
  color: var(--c-ink-deep);
  transform: rotate(90deg);
}

.share-dialog__head {
  padding: var(--s-5) var(--s-5) var(--s-3);
  text-align: center;
}
.share-dialog__title {
  margin: var(--s-3) 0 var(--s-2);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-xl);
  letter-spacing: -0.02em;
  color: var(--c-ink-deep);
}
.share-dialog__subtitle {
  margin: 0;
  color: var(--c-ink-soft);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.share-preview {
  padding: 0 var(--s-5);
}
/* 局内 RECEIPT 的 DOM 副本 · 唯一视觉事实源。
   字号是 360px 基准死值(receipt-v2.css), 缩放只能整体 transform, 不能让容器压宽度。 */
.share-preview .share-receipt-preview {
  --share-rcpt-w: 360px;
  position: relative;
  width: var(--share-rcpt-w);
  height: calc(var(--share-rcpt-w) * 4 / 3); /* 3:4 票据 */
  margin: 0 auto;
}
.share-preview .share-receipt-preview .receipt {
  width: var(--share-rcpt-w);
  transform-origin: top left;
  box-shadow: var(--shadow-soft);
  border-radius: var(--r-lg);
}

.share-primary {
  display: flex;
  margin: var(--s-4) auto var(--s-3);
  width: calc(100% - var(--s-5) * 2);
  justify-content: center;
}

.share-dialog__or {
  margin: var(--s-3) 0 var(--s-3);
  text-align: center;
  color: var(--c-ink-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.share-socials {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  justify-content: center;
  gap: 14px;
  padding: 0 var(--s-5) var(--s-6);   /* 底部 24→32: 图标离弹窗底边太近, 显局促 */
  width: max-content; /* 6 个渠道 · 3 列两行 */
  max-width: 100%;
  margin: 0 auto;
}
.share-social {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(184, 123, 38, 0.4);
  background: rgba(255, 255, 255, 0.7);
  color: var(--c-gold-dark);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 240ms var(--easing-spring-out), background 200ms ease, border-color 200ms ease;
}
.share-social:hover {
  transform: translateY(-2px) scale(1.06);
  background: rgba(232, 204, 122, 0.18);
  border-color: var(--c-gold);
}
.share-social:active { transform: scale(0.94); }

/* Toast · 通用轻提示 (分享操作反馈 / 砂金入账 / 解锁资格提示) · 底部居中进场 */
.share-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  /* 2026-09-04: 教学购买步改走 toast 提示, 需浮在 spotlight 遮罩(1000)之上; 不占用 token 体系新档位,
     直接取 --z-spotlight + 1 (其它非教学场景 toast 也理应压过一切常驻 UI)。 */
  z-index: calc(var(--z-spotlight, 1000) + 1);
  transform: translateX(-50%) translateY(20px);
  padding: 12px 22px;
  border-radius: var(--r-full);
  background: var(--c-bg-dark);
  color: var(--c-ink-on-dark);
  /* 仅换字体族为商品卡标题字体 (2026-09-04 用户拍板): --font-display
     (EN Archivo Black / ZH·JA Noto Sans Bold)。字号 13→11px + 字重 700→400 弱化提醒字 —
     Archivo Black 单字重超黑无细档, 只能靠缩小字号/压字重视觉变轻, 起提醒作用不抢主视觉。 */
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
  box-shadow: 0 12px 28px rgba(31, 26, 15, 0.32);
  opacity: 0;
  transition: opacity 240ms ease, transform 240ms var(--easing-spring-out);
  pointer-events: none;
}
.share-toast.is-in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.share-toast[data-tone='success'] {
  background: linear-gradient(135deg, var(--c-gold-dark) 0%, var(--ink) 100%);
}

/* PC 矮屏(≤1000px, 含 1440×900 矮笔记本): 卡片回到保守高度避免底栏按钮溢出面板。
   2026-09-05: 300px 固定值在 ≤850px 可视高仍放不下(头部/CTA/社媒合计 ~381px + 票据 400px),
   底部社媒 icon 被 overflow 裁掉。改为按可视高反推: (可视高-40 面板边距 - 381 非票据高) × 3/4,
   极矮屏(如 700px)票据缩到 ~209px 也保证一屏装下; 上限仍 300px 不影响原有档位。 */
@media (max-height: 1000px) {
  :root[data-layout="desktop"] .share-preview .share-receipt-preview {
    --share-rcpt-w: min(300px, calc((100vh - 421px) * 3 / 4));
  }
}

/* iPad Safari：分享面板固定到动态可视区，避免页面滚动后 absolute dialog 跑出屏幕。 */

:where(:root[data-layout="tablet"]) {

  .share-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    max-height: calc(100dvh - 40px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
  /* 2026-09-05: 60dvh 在 iPad 横屏(可视高 ~728)算出 437→360 封顶, 票据 480 + 其余 ~381 溢出裁底。
     改按与非票据高(~381)反推, 与 desktop 矮屏同式; 上限仍 360px。 */
  .share-preview .share-receipt-preview {
    --share-rcpt-w: min(360px, calc((100dvh - 421px) * 3 / 4));
  }

}


/* 移动端 · bottom-sheet 全屏 */

:where(:root[data-layout="mobile"]) {

  .share-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px));
    margin: auto 0 0;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .share-dialog__head { padding: var(--s-3) var(--s-4) var(--s-1); }
  /* 2026-09-03: 标题缩小(20→17px) + 右侧留出关闭按钮(36px)避让, 不再遮挡 ×;
     限 2 行 + ellipsis 兜底, 超长标题不顶到右上角关闭钮。 */
  .share-dialog__title {
    font-size: 17px;
    margin: var(--s-2) 0 var(--s-1);
    padding-right: 40px;
    padding-left: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .share-dialog__subtitle { font-size: 12px; }
  /* 2026-09-03: 主按钮文字一行放下 (SAVE IMAGE & COPY TEXT 不再换两行)。
     注: 按钮本身类名是 .primary-button--hero.share-primary (--hero 给了 18px 大字),
     须直接选 .share-primary(按钮自身), 不能选后代 .share-primary .primary-button。 */
  .share-primary {
    font-size: 14px !important;   /* 压过 primary-button--hero 的 18px */
    white-space: nowrap;
    padding: 0 var(--s-3);
    letter-spacing: 0;
    min-height: 48px;
  }
  .share-preview { padding: 0 var(--s-4); }
  /* 手机端一屏装下: 票据宽度按"可视高 - 标题/CTA/社媒/留白 ≈ 320px"反推, 与视口宽取小。
     iPhone 15 (844dvh): (844-320)*3/4 = 393 → 被 100vw-48=342 截住, 实际 342px;
     iPhone SE (667dvh): (667-320)*3/4 = 260 → 260px, 整面板 ~600px 一屏装下。 */
  .share-preview .share-receipt-preview { --share-rcpt-w: min(calc(100vw - 48px), calc((100dvh - 320px) * 3 / 4)); }
  .share-primary { width: calc(100% - var(--s-4) * 2); min-height: 48px; margin-top: var(--s-3); }
  .share-dialog__or { margin: var(--s-2) 0; }
  .share-socials {
    padding-bottom: calc(var(--s-5) + env(safe-area-inset-bottom, 0px));   /* 16→24: 同步放宽 */
  }

}


/* reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .share-dialog__close,
  .share-social,
  .share-toast { transition: none !important; }
}

/* ===== css/tutorial.css ===== */
/* Spotlight 引导 · 遮罩打洞 + chibi 气泡 + 收尾大字 */

.spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-spotlight);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 320ms ease;
  /* 多洞遮罩由 hole 元素的 box-shadow 铺暗, extra hole 用 mix-blend-mode: lighten
     与主洞叠加 (两洞都是透明内 + 暗外, lighten 取较亮值 → 洞内透出底层, 两洞不互相遮挡) */
  isolation: isolate;
}
.spotlight-overlay.is-in { opacity: 1; }
.spotlight-overlay.is-out { opacity: 0; }

/* 洞: box-shadow 反向铺满暗色, 内部透明露出底层 */
.spotlight-hole {
  position: absolute;
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px rgba(31, 26, 15, 0.62),
    0 0 0 3px var(--c-gold),
    0 0 24px 4px rgba(232, 204, 122, 0.55) inset;
  pointer-events: none;
}
.spotlight-hole::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  border: 2px solid var(--c-gold, #E6A94C);
  animation: spotlight-halo 1.8s ease-in-out infinite;
  pointer-events: none;
}
.spotlight-hole {
  transition: top 380ms var(--ease-out),
              left 380ms var(--ease-out),
              width 380ms var(--ease-out),
              height 380ms var(--ease-out);
}
@keyframes spotlight-halo {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.5); }
  50%      { opacity: 1;   box-shadow: 0 0 20px 4px rgba(201, 168, 76, 0.35); }
}

/* 交互步骤: overlay 放行点击 (只让引导卡/按钮可点), 玩家能真点到高亮的商品卡 */
.spotlight-overlay.is-interactive { pointer-events: none; }
.spotlight-overlay.is-interactive .spotlight-card { pointer-events: auto; }

/* 交互教学目标卡: 补一圈金色呼吸, 让玩家明确该点哪张卡 */
.item-card.is-tutorial-target {
  outline: 3px solid var(--c-gold, #E6A94C);
  outline-offset: 5px;
  box-shadow: 0 0 0 5px rgba(230, 169, 76, 0.24), 0 0 26px rgba(230, 169, 76, 0.62) !important;
  animation: tutorial-target-pulse 1.05s ease-in-out infinite;
}
@keyframes tutorial-target-pulse {
  0%, 100% { outline-color: var(--c-gold, #E6A94C); }
  50%      { outline-color: #fff2b8; }
}

/* 指引箭头: 金色, 指向目标商品卡, 上下轻弹 (JS 定位 top/left) */
.spotlight-arrow {
  position: absolute;
  width: 48px;
  height: 48px;
  color: var(--c-gold, #E6A94C);
  filter: drop-shadow(0 3px 8px rgba(31, 26, 15, 0.45));
  pointer-events: none;
  z-index: 1;
  animation: spotlight-arrow-bounce 1s ease-in-out infinite;
}
/* 置于卡片下方时翻转朝上 */
.spotlight-arrow.is-below { transform: scaleY(-1); }
@keyframes spotlight-arrow-bounce {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .spotlight-arrow,
  .item-card.is-tutorial-target { animation: none; }
}

/* 卡片: chibi + 气泡 (JS 动态定位 top/left) */
.spotlight-card {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--r-lg, 20px);
  background: var(--c-bg-elevated, #fff);
  box-shadow: 0 24px 64px rgba(31, 26, 15, 0.42), 0 0 0 2px rgba(201, 168, 76, 0.6);
  transition: top 380ms var(--ease-out),
              left 380ms var(--ease-out);
}

.spotlight-emote-frame {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: visible;
}
.spotlight-emote {
  width: 150px;
  height: 150px;
  object-fit: contain;
  max-width: none;
  flex-shrink: 0;
}

.spotlight-bubble {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: 140px;
}

.spotlight-text {
  margin: 0;
  flex: 1;
  /* 2026-09-09: display:flex → block + align-content:center (行盒组垂直居中, 视觉等价原 flex 居中)。
     根因: <b class="tut-amt">200K</b> 在 flex 容器里被拆成独立 flex item, align-items:center
     让各 item 各自垂直居中 → 金额悬空、基线错位、文字间出现怪异空隙 ("200K 偏移"反馈)。
     block 内联流里 <b> 自然随文排布基线对齐; 旧浏览器不支持 align-content 时退化为顶对齐, 不破版。 */
  display: block;
  align-content: center;
  text-align: center;
  /* 2026-09-06: 教学气泡衬线(Forum/宋体/明朝)观感奇怪, 统一走黑体系 --font-display
     (Noto Sans SC/JP / Archivo Black / 系统黑体)。
     二次调整: 700 偏粗且易超框 → 钉 400 Regular 细档 + 字号收小 (17→15 上限),
     防止长文案把气泡撑超框。 */
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(13px, 1.6vw, 15px);
  line-height: 1.45;
  color: var(--c-ink, #14100a);
}

/* H4: 教学文案里金额数字加粗高亮 (三语 round0SpotlightSteps 共用) */
.spotlight-text .tut-amt {
  font-weight: 700;
  font-size: 1.25em;
}

.spotlight-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spotlight-skip {
  padding: 6px 12px;
  border: 1.5px solid rgba(154, 122, 48, 0.28);
  border-radius: var(--r-full, 9999px);
  background: transparent;
  color: var(--c-ink-soft, #7a746a);
  /* 按钮统一 display (2026-09): 与主操作按钮同族 */
  font-family: var(--font-display);
  font-weight: 700;
  font-synthesis: none;
  font-size: var(--fs-2xs);
  /* skip 一行排下 (兜底, 防窄屏/长文案换行) */
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
}
.spotlight-skip:hover {
  border-color: var(--c-gold, #E6A94C);
  color: var(--c-gold-dark, #C98A3A);
}

.spotlight-progress {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--c-ink-soft, #7a746a);
  letter-spacing: 0.08em;
}

.spotlight-next {
  flex-shrink: 0;
  padding: 8px 20px;
}

/* R3 通关 Bonus · 彩蛋探索 spotlight 双按钮 (继续探索 / 直接结算) */
/* 两按钮同体量 (primary-button compact): 继续探索=黑底次按钮, 直接结算=金底主按钮 */
.spotlight-actions--bonus {
  gap: 12px;
}
.spotlight-actions--bonus .spotlight-skip,
.spotlight-actions--bonus .spotlight-next {
  flex: 0 1 auto;
  min-width: 96px;
  padding: 8px 20px;
  /* 2026-09-03: 手机端按钮内部文字换行(Keep Exploring 两行/Check Out 两行)。
     通用 skip 有 nowrap 但 bonus 覆盖了 padding 把文字挤换行; 强制单行 + 允许按钮收缩。 */
  white-space: nowrap;
  /* 2026-09-04: EN "Keep Exploring"(14字) 在默认 compact 14px 下超框, 且 skip/next 字号不同档。
     bonus 作用域统一压到 --fs-2xs(12px) + padding 24→20px, 两按钮同体量同字号, EN 长文案留够呼吸。 */
  font-size: var(--fs-2xs);
}
/* 继续探索: 黑底白字次按钮 (覆盖 primary-button 的金底 + spotlight-skip 的 ghost 底) */
.spotlight-actions--bonus .spotlight-skip {
  background: var(--c-ink-deep, #1F1A0F);
  color: #FFFFFF;   /* 黑底纯白字(原奶油黄 #FBEFCB 偏黄, 统一改白) */
  border: 0;
}
.spotlight-actions--bonus .spotlight-skip:hover {
  background: var(--ink-hi, #2A2216);
  transform: translateY(-1px);
}
.spotlight-actions--bonus .spotlight-skip:active {
  transform: translateY(0) scale(0.98);
}

/* Mobile 适配 */

:where(:root[data-layout="mobile"]) {

  /* 手机端教学弹窗可读性优先 (2026-09-03/04 用户反馈: 字太小看不清、按钮占中间挤文字)
     新布局: 左 emote | 文字(左对齐占满) | 右侧竖排(👉上 / skip下), 按钮不再横排在文字下方占一整行,
             文字独占中间整列 → 字号上限抬高 + JS 改为 3 行上限, 识别度显著提升。 */
  .spotlight-emote-frame {
    width: 72px;
    height: 72px;
    /* 2026-09-04: 用户反馈立绘未垂直居中 (立绘大图超出 frame, frame align-self 默认 stretch,
       图片顶部跟 frame 顶齐 → 视觉偏上)。align-self:center + place-items:center 让立绘相对 card 垂直居中。
       2026-09-04 二次调整: 立绘整体往右上偏移 4px, 顶部留白太多且与文字间距过近。
       2026-09-04 三次调整: 用户反馈立绘位置仍有偏移(视觉偏左且贴边)、与文字间距太挤。
       frame 64→72 + 立绘 76→86: 立绘放大更醒目, frame 同步放大保持溢出比例一致, 视觉重心更居中;
       去掉 margin-left:-4px 负偏移 (立绘不再硬贴卡片左缘), 文字间距改由 card gap 加大承担。 */
    align-self: center;
    margin-top: -4px;
  }
  .spotlight-emote { width: 86px; height: 86px; }
  /* gap 10→14: 拉开立绘与文字间距, 缓解"看起来很挤" */
  .spotlight-card { padding: 16px 16px 16px 12px; gap: 14px; align-items: center; }
  /* 取消固定 height, 让气泡由文字内容撑高 */
  .spotlight-bubble {
    height: auto;
    min-height: 64px;
    gap: 10px;               /* 8→10: 2026-09-04 实测文字列紧贴右侧按钮列, 再松 2px */
    /* 横向: 文字(弹性占满) + 右侧按钮列 */
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
  }
  /* 文字左对齐、占满中间列; 上限 15→16px, 行高 1.5→1.55
     2026-09-04: 用户反馈文字偏大, 上限 16→15px, 让出空间给立绘与按钮
     2026-09-04 二次: 立绘放大 86px + gap 加大后文字列变窄, 文字再缩一档
     (12.5→12 / 3.6→3.4vw / 15→14.5), 行数不增、与放大立绘视觉配比更协调
     2026-09-06: 字体切黑体后再收一档防超框 (12→11.5 / 3.4→3.2vw / 14.5→13.5) */
  .spotlight-text {
    flex: 1 1 auto;
    min-width: 0;
    display: block;              /* 纯文本左对齐 (base 同为 block, 此处显式声明防回归) */
    align-content: center;       /* 短文案在 min-height 气泡里垂直居中 */
    text-align: left;
    font-size: clamp(11.5px, 3.2vw, 13.5px);
    line-height: 1.55;
  }
  /* 右侧竖排按钮列: 👉 在上, skip 在下 */
  .spotlight-actions {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    align-self: center;
  }
  /* skip 在右侧竖列里: 去 flex 收缩防文字被压扁, 轻微内边距即可 */
  .spotlight-skip { padding: 3px 8px; font-size: 10px; flex-shrink: 0; white-space: nowrap; }
  .spotlight-progress { display: none; }
  /* → 按钮缩到最小, 独占右列不再挤文字。
     双类提特异性压过 .primary-button.compact(0,2,0): 降 min-height + 收紧 padding。 */
  .spotlight-next.primary-button.compact {
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* bonus 双按钮 (继续探索/直接结算): 随 bubble 横向布局排在文字右侧竖列。
     2026-09-04 重做: 原 10px nowrap 让 JA「探索を続ける」6字与正文 15px 差距大且贴边超框,
     改为允许换行 + 字号 11px + 双按钮等宽, 视觉上与正文协调不突兀。
     2026-09-04 二次调整: 右侧竖列固定最小宽度 76px, 让 EN "Keep Exploring"(14字)
     能排成两行完整显示, 与"Check Out"同宽同高, 视觉统一不再乱。 */
  .spotlight-actions--bonus {
    min-width: 80px;           /* 竖列宽度下限: 7px*2 padding + ~66px "Keep Exploring" 宽 */
    flex-shrink: 0;
  }
  .spotlight-actions--bonus .spotlight-skip,
  .spotlight-actions--bonus .spotlight-next {
    min-width: 0;
    width: 100%;              /* 双按钮在右侧竖列里等宽, 视觉对齐 */
    min-height: 32px;         /* 双按钮统一最小高度, 保持触控 + 视觉一致 */
    padding: 7px 6px;         /* padding-inline 收窄 10→6, 给文字更多空间 */
    font-size: 11px;
    line-height: 1.3;
    /* 去掉 nowrap: JA 6字 / EN "Keep Exploring" 在窄列里换行成两行, 比硬挤一行更易读 */
    white-space: normal;
    text-align: center;
    letter-spacing: 0;
  }
  /* 关键: bonus 作用域下的 next 要压过上面 .spotlight-next.primary-button.compact 的 28×28 方框。
     后者是单 → 箭头专用 (R0 单按钮步骤); bonus 是双文字按钮, 不能被 28px 框压扁。
     特异性 (0,4,0) 盖过 (0,3,0)。 */
  .spotlight-actions--bonus .spotlight-next.primary-button.compact {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 32px;         /* 与 skip 统一 32px, 保持触控 + 视觉一致 */
    padding: 7px 6px;         /* 与 skip 统一 padding */
    font-size: 11px;
    line-height: 1.3;
    white-space: normal;
  }

  /* ─── 手机端 toast 卡 (购买步) ───
     toast 卡骨架与上面默认 mobile 布局一致 (emote 左 / 文字中 / 按钮右),
     但 bubble 改一行横排 (覆盖 flex-direction: row 的冲突), 立绘缩到 toast 尺寸。 */
  .spotlight-card.is-toast-card {
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 8px;
    border-radius: var(--r-full, 9999px);
  }
  .spotlight-card.is-toast-card .spotlight-emote-frame {
    width: 48px;
    height: 48px;
    align-self: center;
    margin-left: 0;
    margin-top: 0;
  }
  .spotlight-card.is-toast-card .spotlight-emote {
    width: 56px;
    height: 56px;
  }
  .spotlight-card.is-toast-card .spotlight-bubble {
    height: auto;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }
  .spotlight-card.is-toast-card .spotlight-text {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    text-align: center;
    /* 2026-09-06: 黑体化后同步收小一档防超框 (12→11.5 / 3.4→3.2vw / 14→13) */
    font-size: clamp(11.5px, 3.2vw, 13px);
    line-height: 1.45;
  }
  .spotlight-card.is-toast-card .spotlight-actions {
    flex-direction: row;
    gap: 4px;
    flex-shrink: 0;
    align-self: center;
  }

}


/* ─── 教学购买步 · toast 形态 (2026-09-04) ───
   buy-flying / buy-sparkle 步把大卡片瘦身成细长 toast (带立绘):
   立绘缩到左侧, 文字一行居中, 不再大面积遮挡商品区;
   洞/箭头/is-tutorial-target 保留。文案在立绘与按钮之间居中, 少量 padding。 */
.spotlight-card.is-toast-card {
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 10px;
  border-radius: var(--r-full, 9999px);
}
.spotlight-card.is-toast-card .spotlight-emote-frame {
  width: 56px;
  height: 56px;
  align-self: center;
  margin-left: 0;
  margin-top: 0;
}
.spotlight-card.is-toast-card .spotlight-emote {
  width: 64px;
  height: 64px;
}
.spotlight-card.is-toast-card .spotlight-bubble {
  height: auto;
  min-height: 0;
  flex-direction: row;
  align-items: center;
  justify-content: center;    /* 文本在 emote 与按钮之间居中 */
  gap: 8px;
  width: 100%;
}
.spotlight-card.is-toast-card .spotlight-text {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  text-align: center;
  font-size: clamp(12px, 1.4vw, 14px);   /* 2026-09-06: 黑体化后收小 (13→12 / 1.5→1.4vw / 15→14) 防超框 */
  line-height: 1.45;
}
.spotlight-card.is-toast-card .spotlight-actions {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  align-self: center;
}
.spotlight-card.is-toast-card .spotlight-next.primary-button.compact {
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.spotlight-card.is-toast-card .spotlight-skip { padding: 3px 8px; font-size: 10px; flex-shrink: 0; white-space: nowrap; }
.spotlight-card.is-toast-card .spotlight-progress { display: none; }

@media (prefers-reduced-motion: reduce) {
  .spotlight-hole,
  .spotlight-card { transition: opacity 200ms ease; }
  .spotlight-hole::before { animation: none; }
}

/* ===== css/special-effects.css ===== */
/* 购买后计时类演出 · 覆盖层视觉。
   由 js/special-effects.js 动态注入元素; 本层 pointer-events:none, 不拦交互。
   尺寸走 vw/vh/clamp 流式适配三端, 不引入宽度媒体查询 (布局档判定仍归 html[data-layout])。 */

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-spotlight);
  pointer-events: none;
  overflow: hidden;
}
.fx-run {
  position: absolute;
  inset: 0;
  transition: opacity 0.35s ease;
}
.fx-run.is-leaving { opacity: 0; }

/* ─────── 玫瑰花瓣雨 (H7) ─────── */
.fx-petal {
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 1.15);
  background: radial-gradient(120% 120% at 30% 20%, #ff9ec4 0%, #ff5e8a 45%, #d63c68 100%);
  border-radius: 100% 6% 100% 6%;
  filter:
    hue-rotate(calc(var(--hue, 0) * 1deg))
    drop-shadow(0 2px 3px rgba(150, 30, 60, 0.25));
  opacity: 0;
  transform: translate3d(0, -12vh, 0);
  animation: fx-petal-fall var(--dur) linear var(--delay) forwards;
  will-change: transform, opacity;
}
/* 低端降级: 去掉 hue-rotate/drop-shadow 滤镜 (动画元素每帧重绘滤镜是低端机掉帧主因) */
.fx-run[data-fx-lite] .fx-petal { filter: none; }
@keyframes fx-petal-fall {
  0%   { transform: translate3d(0, -12vh, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.95; }
  90%  { opacity: 0.95; }
  100% { transform: translate3d(var(--drift), 112vh, 0) rotate(var(--spin)); opacity: 0.85; }
}

/* ─────── 火花打花火 (H_firework) ─────── */
/* 与阿哈 takeover 同为剧情彩蛋演出: 期间拦截全屏点击 (pointer-events:auto), 背景购买不可点。 */
.fx-firework {
  pointer-events: auto;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 48%, rgba(20, 14, 8, 0.28), rgba(20, 14, 8, 0.42));
  animation: fx-fw-bg 0.4s ease both;
}
.fx-firework__img {
  width: clamp(220px, 62vw, 420px);
  height: auto;
  filter: drop-shadow(0 12px 32px rgba(31, 26, 15, 0.35));
  /* 入场弹一下, 随后持续 wiggle 摇摆, 更搞笑 */
  transform-origin: center bottom;
  animation:
    fx-fw-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    fx-fw-wiggle 0.62s ease-in-out 0.45s infinite;
}
@keyframes fx-fw-bg {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fx-fw-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
/* wiggle: 左右小幅摇摆 + 轻微缩放, 卡通抖动感 */
@keyframes fx-fw-wiggle {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  25%      { transform: rotate(3deg) scale(1.03); }
  50%      { transform: rotate(-2.5deg) scale(1); }
  75%      { transform: rotate(3.5deg) scale(1.03); }
}

/* ─────── 真理兔健身指导 (ratio_rabbit_gym) / 大地兽肉排·那刻夏贴纸 (beast_steak) ─────── */
/* 快速出现的原商品图/贴纸：仅作购买确认，不遮挡、不暂停倒计时。
   --fx-pop-dur 由 js/special-effects.js 按配置 durationMs 写入 (与到点即删的
   immediateFinish 计时严格同步, 动画播完恰在 DOM 移除前), 默认 850ms。
   入场为 Q 弹回弹: 缩小+微旋登场 → 过冲放大 (压扁感) → 回稳; 贴纸感靠退场前的小幅上飘。 */
.fx-rabbit-gym {
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(32, 25, 17, 0.18), rgba(32, 25, 17, 0) 68%);
}
.fx-rabbit-gym__img {
  width: min(70vw, 480px);
  max-height: min(50vh, 280px);
  object-fit: contain;
  filter: drop-shadow(0 14px 26px rgba(31, 26, 15, 0.35));
  transform-origin: 50% 68%;              /* 回弹锚点略靠下, 弹跳更像贴纸跳起 */
  animation: fx-rabbit-gym-pop var(--fx-pop-dur, 0.85s) cubic-bezier(.22, .9, .34, 1) both;
}
@keyframes fx-rabbit-gym-pop {
  0%    { opacity: 0; transform: translateY(26px) scale(0.55) rotate(-5deg); }
  40%   { opacity: 1; transform: translateY(0) scale(1.1) rotate(2.5deg); }   /* 过冲, 弹跳感 */
  60%   { opacity: 1; transform: translateY(0) scale(0.965) rotate(-1deg); } /* 回压, 橡皮感 */
  74%, 84% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }   /* 回稳定格 */
  100%  { opacity: 0; transform: translateY(-14px) scale(1.03) rotate(2deg); }
}

/* 教学首通彩带全屏层 · fixed 覆盖全屏, 不拦交互; 内含 .fx-ribbon 从顶飘落 (confetti.js 编排) */
/* 前景层经 popover 抬进 top layer (confetti.js): 必须显式压掉 UA [popover] 样式
   (margin:auto / fit-content 尺寸 / 边框 / 底色), 否则层会塌缩成内容尺寸居中 */
.fx-confetti-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  z-index: var(--z-fx-top);            /* 高于 focus/结算; body 直挂时低于弹窗 top layer */
  overflow: hidden;
  pointer-events: none;
}
.fx-confetti-layer.is-foreground {
  z-index: var(--z-banner);           /* 兜底: 不支持 popover 的旧浏览器退回 z-index 分层 */
}
/* 背景彩带 · 顶部飘落 + 旋转, 六色循环 */
.fx-ribbon {
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--w);
  height: calc(var(--w) * 2.4);
  border-radius: 2px;
  opacity: 0;
  transform: translate3d(0, -12vh, 0);
  animation: fx-ribbon-fall var(--dur) linear var(--delay) forwards;
  will-change: transform, opacity;
}
@keyframes fx-ribbon-fall {
  0%   { transform: translate3d(0, -12vh, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.95; }
  100% { transform: translate3d(var(--drift), 114vh, 0) rotate(var(--spin)); opacity: 0.9; }
}

/* ─────── 睡蕉小猴瀑布 (reverse_lab) ─────── */
/* 猴子 + 香蕉 emoji 从顶部密集下落, 占满全屏, 像弹幕/瀑布 */
.fx-fall {
  position: absolute;
  top: 0;
  left: var(--x);
  opacity: 0;
  transform: translate3d(0, -15vh, 0);
  animation: fx-fall var(--dur) linear var(--delay) forwards;
  will-change: transform, opacity;
}
.fx-fall.fx-monkey {
  width: var(--size);
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(31, 26, 15, 0.28));
}
.fx-fall.fx-banana {
  font-size: var(--size);
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(31, 26, 15, 0.22));
}
/* 低端降级: 猴/蕉去 drop-shadow (同花瓣, 动画期滤镜重绘是低端掉帧主因) */
.fx-run[data-fx-lite] .fx-fall { filter: none; }
@keyframes fx-fall {
  0%   { transform: translate3d(0, -15vh, 0) rotate(0deg) scale(0.7); opacity: 0; }
  6%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translate3d(var(--drift), 118vh, 0) rotate(var(--spin)) scale(1); opacity: 0.95; }
}

/* ─────── 药师赐福聚光 (lifeprolong) ─────── */
/* 背景暗化+模糊; 光束从底部向上收窄, 顶部聚焦到砂金财富位置; 药师图居中放大立于光束。 */
.fx-spotlight {
  inset: 0;
  background: radial-gradient(circle at 50% 12%,
    rgba(12, 8, 3, 0.06) 0%, rgba(8, 5, 2, 0.62) 58%, rgba(6, 4, 1, 0.84) 100%);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: fx-sp-in 0.45s ease both;
}
/* 实体光束 (反转): 底部窄 → 顶部宽, 向上散开框住顶部倒计时 (照蓝线); screen 加光更亮实 */
.fx-spotlight__beam {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(96vw, 900px);
  height: 100%;
  background: linear-gradient(to top,
    rgba(255, 220, 140, 0.10) 0%, rgba(255, 230, 165, 0.42) 50%, rgba(255, 245, 210, 0.78) 100%);
  clip-path: polygon(40% 100%, 60% 100%, 2% 0, 98% 0);
  mix-blend-mode: screen;
  filter: blur(1.5px);
  animation: fx-sp-beam 1.4s ease-in-out infinite alternate;
}
/* 顶部聚焦光斑 · 对准真实倒计时位置, 把它"打亮" */
.fx-spotlight__focus {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(72vw, 480px);
  height: clamp(130px, 22vh, 220px);
  transform: translate(-50%, -34%);
  background: radial-gradient(ellipse at center,
    rgba(255, 245, 210, 0.7) 0%, rgba(255, 220, 140, 0.32) 42%, transparent 72%);
  mix-blend-mode: screen;
  filter: blur(2px);
}
/* 药师图 · 大幅放大居中 (略偏下让顶部倒计时聚焦) */
.fx-spotlight__art {
  position: absolute;
  top: 63%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* 抬到 beam/focus 之上, 确保立绘清透可见 (光束 screen 混合只作氛围, 不蒙灰美术资产) */
  z-index: 1;
  width: clamp(340px, 66vw, 640px);
  max-height: 76vh;
  height: auto;
  /* 蓝金晕染底(去棕金滤镜): 蓝心→淡蓝→金收边, 收敛投影 */
  background: radial-gradient(56% 56% at 50% 46%,
    rgba(126, 199, 242, 0.34) 0%,
    rgba(180, 218, 244, 0.16) 46%,
    rgba(247, 205, 110, 0.15) 72%,
    rgba(255, 255, 255, 0) 90%);
  border-radius: 24px;
  filter: drop-shadow(0 14px 28px rgba(31, 26, 15, 0.22));
  animation: fx-sp-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes fx-sp-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fx-sp-pop {
  0%   { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  60%  { transform: translate(-50%, -50%) scale(1.03); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes fx-sp-beam {
  from { opacity: 0.75; }
  to   { opacity: 1; }
}

/* 药师聚光期间: 倒计时「聚焦高亮」——背景由 fx-spotlight 覆盖层暗化, 倒计时原位
   金环主框 + 视觉放大, 数字滚动上涨 +N 秒 (外层 fx-spotlight-hole 只叠柔光晕, 不再加第二道实框)。
   倒计时保持原位 (不再 re-parent), 避免旧实现 inline transform 覆盖 scale / font-size 撑高 focus-bar 导致布局跳动; 抬层级压过覆盖层。 */
.countdown-display.is-spotlit {
  /* 不改 font-size, 保持原 countdown 尺寸不变 (移动端 ~32-44px, PC ~64-100px) */
  padding: 4px 22px;
  border-radius: 16px;
  background: rgba(255, 248, 224, 0.92);
  /* 金环 + 外发光: 呼应教学 spotlight-hole 的抠洞高亮 */
  box-shadow: 0 0 0 3px rgba(232, 204, 122, 0.95), 0 0 34px rgba(232, 204, 122, 0.7);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  /* 视觉放大用 transform (不触发 reflow), 配合 transition 平滑弹出 */
  transform: scale(1.35);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* 抬层级: 压过 fx-spotlight 覆盖层(--z-spotlight)与 fx-spotlight-hole 暗层 */
  position: relative;
  z-index: calc(var(--z-spotlight) + 2);
}
/* 药师演出期倒计时暂停: 覆盖 data-paused 的半透明 + ⏸ 前缀, 保持高亮清晰可读 */
.focus-bar .countdown-display.is-spotlit[data-paused='true'] {
  color: inherit;
  opacity: 1;
  animation: none;
}
.focus-bar .countdown-display.is-spotlit[data-paused='true']::before {
  content: none;
}

/* 药师打洞: fixed 定位到倒计时原位, 只做一圈「向外扩散的柔光聚焦」(无实体边框)。
   倒计时本体 (is-spotlit) 已有金环主框; hole 若再叠实金环/描边会出现内外两个框 —— 故 hole 只留柔光晕, 拉开层次。
   背景暗化由 fx-spotlight 覆盖层自身 (radial 渐变 + blur) 承担, 不反向铺暗, 避免压暗药师大图。 */
.fx-spotlight-hole {
  position: fixed;
  border-radius: 20px;
  box-shadow: 0 0 0 6px rgba(232, 204, 122, 0.18), 0 0 42px 10px rgba(232, 204, 122, 0.4);
  pointer-events: none;
  z-index: calc(var(--z-spotlight) + 1);
  animation: fx-sp-hole-in 0.4s ease both;
}
@keyframes fx-sp-hole-in { from { opacity: 0; } to { opacity: 1; } }

/* ─────── 阿哈 takeover (H6) ─────── */
/* GSAP 涡旋 canvas + 中央彩蛋图浮现/猛然放大 + 金色爆闪环。
   与其他装饰演出不同: takeover 期间拦截全屏点击 (pointer-events:auto),
   背景购买不可点, 仅 SKIP 按钮 (自身 auto, z-index 4) 可点跳过。 */
.fx-takeover {
  pointer-events: auto;
  background: rgba(10, 6, 4, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: fx-takeover-bg 0.6s ease-out both;
}
@keyframes fx-takeover-bg {
  from {
    background: rgba(10, 6, 4, 0);
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
  }
  to {
    background: rgba(10, 6, 4, 0.62);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
}
/* GSAP 涡旋 canvas */
.fx-takeover canvas {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: block;
}
/* 中央阿哈彩蛋图 (盖住涡旋) · 初始 scale(0.3) 隐藏, 1.5s 由 JS 浮现, 2.8s 猛然放大 */
.fx-takeover__art {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: clamp(280px, 48vw, 520px);
  max-height: 68vh;
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  /* 金色高亮描边 + 光晕 */
  filter:
    drop-shadow(0 0 2px rgba(255, 220, 140, 0.9))
    drop-shadow(0 0 22px rgba(255, 200, 80, 0.75))
    drop-shadow(0 0 64px rgba(255, 180, 60, 0.4))
    drop-shadow(0 12px 32px rgba(0, 0, 0, 0.5));
  will-change: transform, opacity;
}
/* 猛然放大时的金色爆闪环 (2.8s 才创建, 外圈扩散特效) */
.fx-takeover__flash {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 14vmin;
  height: 14vmin;
  border-radius: 50%;
  border: 5px solid rgba(255, 215, 110, 0.95);
  box-shadow:
    0 0 40px rgba(255, 200, 90, 0.7),
    inset 0 0 40px rgba(255, 200, 90, 0.35);
  opacity: 0;
  animation: fx-takeover-flash 0.8s cubic-bezier(0.2, 0.6, 0.3, 1) both;
  will-change: width, height, opacity;
}
@keyframes fx-takeover-flash {
  0%   { width: 14vmin; height: 14vmin; opacity: 1; border-width: 6px; }
  100% { width: 135vmin; height: 135vmin; opacity: 0; border-width: 1px; }
}
/* 跳过按钮 (takeover 容器已 pointer-events:auto 拦全屏, 按钮 z-index 4 在最上可点) */
.fx-takeover__skip {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 4;
  padding: 10px 22px;
  font-size: 14px;
  color: rgba(255, 220, 150, 0.8);
  background: rgba(20, 14, 8, 0.6);
  border: 1px solid rgba(255, 210, 100, 0.25);
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: color 0.2s, border-color 0.2s;
  pointer-events: auto;
}
.fx-takeover__skip:hover {
  color: #ffd166;
  border-color: rgba(255, 210, 100, 0.6);
}

/* 降级: 火花只淡入不 wiggle, 花瓣与瀑布去缓动 (数量已在 JS 降低); 聚光去掉弹入/光束脉动; 阿哈去掉爆闪环 */
@media (prefers-reduced-motion: reduce) {
  .fx-firework__img { animation: fx-fw-bg 0.3s ease both; }
  /* 全局 reduce-motion 会用 !important 把动画压到 0.01ms；不能保留会以 opacity:0 收尾的 keyframe。
     这里改为完整静态图，直到 1.15s 演出计时结束才由 JS 清理。 */
  .fx-rabbit-gym__img { animation: none !important; opacity: 1; transform: none; }
  .fx-petal { animation-timing-function: ease-out; }
  .fx-fall { animation-timing-function: ease-out; }
  .fx-spotlight__art { animation: fx-sp-in 0.3s ease both; }
  .fx-spotlight__beam { animation: none; }
  .fx-takeover__flash { display: none; }
}

/* ===== css/endless-draw.css ===== */
/* MAX OUT 四卡舞台。仅 [data-mode="endless"] 生效，普通 R1–R3 零影响。 */

#challengeRoot[data-mode="endless"] #diceButton,
#challengeRoot[data-mode="endless"] #diceRemaining,
#challengeRoot[data-mode="endless"] #diceCooldown {
  display: none !important;
}

#challengeRoot[data-mode="endless"] #shop {
  position: relative;
  overflow: hidden;
  padding: 0;
  mask-image: none;
  -webkit-mask-image: none;
}

#challengeRoot[data-mode="endless"] .item-grid {
  --max-drag-x: 0px;
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-content: stretch;
  padding: 0;
  /* 双击缩放复活点 → manipulation (与 app-shell-guard 一致) */
  touch-action: manipulation;
  transition: opacity 180ms ease;
}

#challengeRoot[data-mode="endless"] .item-card[data-tap-buy] {
  --max-stage-rotate: 0deg;
  --max-stage-y: 0px;
  position: relative;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  margin: 0;
  contain: paint;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  opacity: 1;
  filter: none;
  transform: translateX(var(--max-drag-x)) translateY(var(--max-stage-y)) rotate(var(--max-stage-rotate));
  transform-origin: 50% 82%;
  transition: transform 170ms cubic-bezier(0.2, 0.75, 0.2, 1), filter 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}
#challengeRoot[data-mode="endless"] .item-card[data-tap-buy] .item-actions { display: none; }
#challengeRoot[data-mode="endless"] .item-card[data-tap-buy]:active { translate: 0 2px; }
#challengeRoot[data-mode="endless"] .item-card[data-tap-buy]:focus-visible {
  outline: 3px solid var(--sand-gold-hi, #FFF0C0);
  outline-offset: -4px;
}
#challengeRoot[data-mode="endless"] .item-card .item-meta { display: none; }
#challengeRoot[data-mode="endless"] .item-card .item-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 四卡始终清晰；视觉焦点只给轻描边，不改购买能力、清晰度或可见性。 */
#challengeRoot[data-mode="endless"] .item-card[data-stage-focus="true"] {
  box-shadow: inset 0 0 0 2px rgba(255, 240, 192, 0.72), 0 14px 32px rgba(184, 123, 38, 0.22);
}

/* 隐藏返场沿用原卡视觉语义，仅保留 Limited；不新增 NEW/遗珠/返场标识。 */
#challengeRoot[data-mode="endless"] .item-card[data-danger="true"] {
  background: var(--ink);
  border: 1px solid rgba(232, 204, 122, 0.24);
  box-shadow: inset 0 1px 0 rgba(126, 199, 242, 0.13),
              0 12px 30px rgba(20, 16, 10, 0.22);
}
#challengeRoot[data-mode="endless"] .item-card[data-tier="T3"],
#challengeRoot[data-mode="endless"] .item-card[data-tier="T4"] {
  box-shadow: inset 0 0 0 1px rgba(240, 200, 120, 0.5), 0 12px 30px rgba(184, 123, 38, 0.22);
}

/* MAX OUT 二色制: 非黑金(≥50亿 data-danger)即白卡 — 含隐藏返场/浅金, 统一回归普通模式白卡包装,
   不按 max-kind/位置染色。Limited 身份只由右上角角标表达(全局 .item-badge), 卡面不额外加戏。 */
#challengeRoot[data-mode="endless"] .item-card:not([data-danger="true"]) {
  background: var(--paper-elevated);
  color: var(--c-ink);
  box-shadow: inset 0 0 0 1px rgba(31, 26, 15, 0.06),
              0 6px 18px rgba(31, 26, 15, 0.05);
}
#challengeRoot[data-mode="endless"] .item-card:not([data-danger="true"]) .item-title,
#challengeRoot[data-mode="endless"] .item-card:not([data-danger="true"]) .price {
  color: var(--c-ink-deep);
}
#challengeRoot[data-mode="endless"] .item-card:not([data-danger="true"]) .item-image-slot {
  background: var(--glow-slot);
}

/* 单槽 impact：新卡立即在底层可购，旧卡 ghost 在约 200ms 内下冲、回弹并淡出。 */
#challengeRoot[data-mode="endless"] .item-card.max-restock {
  animation: maxRestockIn 200ms ease-out both;
}
#challengeRoot[data-mode="endless"] .max-impact-ghost,
#challengeRoot[data-mode="endless"] .max-sweep-ghost {
  position: absolute !important;
  z-index: 20;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: var(--s-2);
  padding: var(--s-3);
  overflow: hidden;
  border-radius: var(--r-lg);
  margin: 0 !important;
  pointer-events: none !important;
  transform: none;
  filter: none;
}
#challengeRoot[data-mode="endless"] .max-impact-ghost {
  background: var(--paper-elevated, #fff);
  box-shadow: inset 0 0 0 1px rgba(31, 26, 15, 0.06), 0 10px 26px rgba(0, 0, 0, 0.16);
  animation: maxImpactGhost 210ms cubic-bezier(0.25, 0.7, 0.35, 1) both;
}
#challengeRoot[data-mode="endless"] .max-impact-ghost[data-danger="true"],
#challengeRoot[data-mode="endless"] .max-sweep-ghost[data-danger="true"] {
  color: #f0ead8;
  background: var(--ink);
  border: 1px solid rgba(240, 200, 120, 0.42);
}
#challengeRoot[data-mode="endless"] .item-grid.is-max-impacting > .item-card:not(.max-restock) {
  animation: maxImpactInward 210ms ease-out both;
}
@keyframes maxRestockIn {
  0% { opacity: 0.72; transform: translateX(var(--max-drag-x)) translateY(calc(var(--max-stage-y) - 5px)) rotate(var(--max-stage-rotate)) scale(0.985); }
  100% { opacity: 1; transform: translateX(var(--max-drag-x)) translateY(var(--max-stage-y)) rotate(var(--max-stage-rotate)) scale(1); }
}
@keyframes maxImpactGhost {
  0% { opacity: 0.88; transform: translateY(0) scale(1); }
  48% { opacity: 0.72; transform: translateY(15px) scale(0.985); }
  72% { opacity: 0.42; transform: translateY(7px) scale(1.01); }
  100% { opacity: 0; transform: translateY(23px) scale(0.97); }
}
@keyframes maxImpactInward {
  0%, 100% { translate: 0 0; }
  48% { translate: var(--max-impact-inset, 0px) 0; }
}

/* Sweep：短锁输入但倒计时继续。旧四卡 ghost 内收，金色扫描，新组在 420ms 内展开。 */
#challengeRoot[data-mode="endless"] .item-grid.is-max-sweeping {
  pointer-events: none;
}
#challengeRoot[data-mode="endless"] .item-grid.is-max-sweeping::after {
  content: '';
  position: absolute;
  z-index: 40;
  inset: -20% -12%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255, 243, 196, 0.18) 43%, rgba(240, 200, 120, 0.88) 49%, rgba(255, 243, 196, 0.2) 55%, transparent 63%);
  transform: translateX(-115%);
  animation: maxSweepScan 420ms ease-in-out both;
}
#challengeRoot[data-mode="endless"] .item-grid.is-max-sweeping > .item-card {
  animation: maxSweepReveal 420ms cubic-bezier(0.2, 0.85, 0.2, 1) both;
  animation-delay: calc(var(--max-slot-index, 0) * 18ms);
}
#challengeRoot[data-mode="endless"] .max-sweep-ghost {
  animation: maxSweepGhost 420ms ease-in both;
}
@keyframes maxSweepScan {
  0% { opacity: 0; transform: translateX(-115%); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateX(115%); }
}
@keyframes maxSweepReveal {
  0%, 42% { opacity: 0.2; transform: translateX(var(--max-drag-x)) translateY(var(--max-stage-y)) rotate(var(--max-stage-rotate)) scale(0.92); }
  100% { opacity: 1; transform: translateX(var(--max-drag-x)) translateY(var(--max-stage-y)) rotate(var(--max-stage-rotate)) scale(1); }
}
@keyframes maxSweepGhost {
  0% { opacity: 0.92; transform: translate(0, 0) scale(1); }
  58% { opacity: 0.52; transform: translate(var(--max-sweep-inset-mid, 0px), 12px) scale(0.72); }
  100% { opacity: 0; transform: translate(var(--max-sweep-inset-end, 0px), 20px) scale(0.42); }
}

/* 金卡为网格上方独立覆盖层；背景四卡压到约 0.52 brightness，无 blur。 */
#challengeRoot[data-mode="endless"][data-gold-phase="true"] .item-grid > .item-card {
  filter: brightness(0.52) saturate(0.72);
  pointer-events: none;
}
.max-gold-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 120;
  touch-action: manipulation;   /* 金卡狂按: 显式禁双击缩放 (触屏连击兜底) */
  width: min(40vw, 292px);
  min-height: min(72%, 410px);
  padding: 42px 18px 16px;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto auto auto;
  place-items: center;
  gap: 7px;
  overflow: hidden;
  border: 2px solid #FFE7A0;
  border-radius: 22px;
  color: #241C10;
  background:
    repeating-linear-gradient(118deg, rgba(255,255,255,0.2) 0 1px, transparent 1px 9px),
    linear-gradient(145deg, #F0C878 0%, #E0B45E 29%, #F8E3AC 52%, #C8963E 78%, #EFCB7A 100%);
  box-shadow: 0 0 72px 18px rgba(240, 214, 138, 0.58), 0 26px 64px rgba(0, 0, 0, 0.62), inset 0 0 0 4px rgba(94, 74, 20, 0.24);
  cursor: pointer;
  isolation: isolate;
  animation: maxGoldEnter 260ms cubic-bezier(0.2, 0.9, 0.2, 1) both,
             maxGoldGlow 680ms ease-in-out 260ms infinite;
}
.max-gold-overlay::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid rgba(83, 45, 5, 0.48);
  border-radius: 15px;
  box-shadow: inset 0 0 22px rgba(255, 246, 199, 0.46);
}
.max-gold-overlay__shine {
  position: absolute;
  z-index: 8;
  inset: -35% auto -35% -55%;
  width: 34%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  transform: skewX(-18deg);
  animation: maxGoldShine 1050ms ease-in-out infinite;
}
.max-gold-overlay__plaque {
  position: absolute;
  top: 12px;
  z-index: 4;
  padding: 5px 14px;
  border: 1px solid rgba(58, 30, 2, 0.72);
  border-radius: 999px;
  color: #FFF3C4;
  background: linear-gradient(180deg, #5C3106, #211104);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.13em;
}
.max-gold-overlay img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(79, 39, 2, 0.35));
}
.max-gold-overlay strong {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.15;
  text-shadow: 0 1px rgba(255, 249, 214, 0.75);
}
.max-gold-overlay__price,
.max-gold-overlay__hits {
  font-family: var(--font-mono);
  font-weight: 1000;
}
.max-gold-overlay__hits {
  padding: 6px 14px;
  font-size: 16px;
  border: 1px solid rgba(68, 35, 3, 0.38);
  border-radius: 999px;
  color: #FFF3C4;
  background: rgba(50, 25, 2, 0.76);
}
.max-gold-overlay__ticks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  width: 82%;
}
.max-gold-overlay__ticks i {
  height: 7px;
  border: 1px solid rgba(67, 33, 2, 0.46);
  border-radius: 999px;
  background: rgba(72, 38, 5, 0.18);
  transition: background 100ms ease, box-shadow 100ms ease, transform 100ms ease;
}
.max-gold-overlay__ticks i.is-hit {
  background: #FFF5C7;
  box-shadow: 0 0 10px 2px rgba(255, 245, 199, 0.9);
  transform: scaleY(1.35);
}
.max-gold-overlay__timer {
  width: 88%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(64, 31, 2, 0.22);
}
.max-gold-overlay__timer i {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #6B3504, #FFF3C4);
  animation: maxGoldTimer 3000ms linear both;
}
.max-gold-overlay.is-struck {
  animation: maxGoldStrike 150ms cubic-bezier(0.2, 0.85, 0.2, 1), maxGoldGlow 680ms ease-in-out 150ms infinite;
}
.max-gold-overlay[data-hit="4"].is-struck,
.max-gold-overlay[data-hit="5"].is-struck { animation-name: maxGoldStrikeStrong, maxGoldGlow; }
.max-gold-overlay[data-hit="6"].is-struck { animation-name: maxGoldStrikeFinal, maxGoldGlow; }
@keyframes maxGoldEnter {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72) rotate(-2deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}
@keyframes maxGoldGlow {
  50% { box-shadow: 0 0 90px 26px rgba(240, 200, 120, 0.72), 0 26px 64px rgba(0, 0, 0, 0.62), inset 0 0 0 4px rgba(94, 52, 7, 0.24); }
}
@keyframes maxGoldShine {
  0%, 18% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  36% { opacity: 0.95; }
  66%, 100% { transform: translateX(520%) skewX(-18deg); opacity: 0; }
}
@keyframes maxGoldTimer { to { transform: scaleX(0); } }
@keyframes maxGoldStrike {
  35% { transform: translate(-50%, -50%) scale(0.965) rotate(-0.6deg); }
}
@keyframes maxGoldStrikeStrong {
  30% { transform: translate(-50%, -50%) scale(0.95) rotate(1.2deg); filter: brightness(1.16); }
}
@keyframes maxGoldStrikeFinal {
  28% { transform: translate(-50%, -50%) scale(1.08) rotate(-1.5deg); filter: brightness(1.32); }
}

/* Mobile：2×2，卡片直立对齐，不旋转不位移。
   2026-09 任务3: 旧 grid-template-rows 1fr auto auto 把 ~44% 多余空间堆在图区行,
   图与标题之间大段空白。改 auto auto auto 内容驱动 + align-self:start, 行高按内容;
   align-content:center 让 2×2 整体在 shop 内垂直居中, 上下留白对称不顶部堆叠。 */
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* 2026-09-03 卡片同尺寸: 行高均分(1fr) + 卡片 stretch 填满, 文字行数差异由内部 clamp 吸收,
     regardless 文本长度所有商品格一样大 (原 auto+start 按内容撑 → 大小不一)。
     minmax(min-content,1fr): 内容是下限保底不重叠, 两格再 1fr 均分取齐。 */
  grid-template-rows: repeat(2, minmax(min-content, 1fr));
  align-content: center;
  gap: 10px;
}
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-card {
  padding: 10px;
  grid-template-rows: auto auto auto;
  align-self: stretch;   /* 填满 grid 行, 与同格卡同高 */
  min-width: 0;
}
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-image-slot {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 10;
}
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-title {
  /* MAX OUT 副标题已隐藏 (line 57), 腾出的高度让给标题折行;
     EN/JA 长名 (如 p45 58字符) 在 ~152px 卡宽内 clamp(2) 必截断 → 放宽 3 行 + 字号降一档。 */
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.22;
  -webkit-line-clamp: 3;
  /* 标题区预留固定 3 行高, 短标题卡也占满 → 同行卡价格行对齐, 卡片内部布局一致 */
  min-height: calc(3 * 1.22 * clamp(11px, 3vw, 13px));
}
:root[data-layout="mobile"] .max-gold-overlay { width: min(70vw, 258px); min-height: 64%; }

/* Tablet 竖屏：2×2，卡片直立对齐，不旋转。同 mobile 改内容驱动消除多余空间。 */
:root[data-layout="tablet"] #challengeRoot[data-mode="endless"] .item-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  align-content: center;
  gap: 10px;
}
:root[data-layout="tablet"] #challengeRoot[data-mode="endless"] .item-card {
  padding: 10px;
  grid-template-rows: auto auto auto;
  align-self: start;
}
:root[data-layout="tablet"] #challengeRoot[data-mode="endless"] .item-image-slot {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 10;
}

/* Desktop：4×1 直立对齐，不旋转不位移。 */
:root[data-layout="desktop"] #challengeRoot[data-mode="endless"] .item-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  padding: 0 clamp(56px, 7vw, 108px) 12px;
}

/* Tablet 横屏：同 Desktop 4×1 直立对齐；orientation 仅作 tablet 档内修饰。 */
@media (orientation: landscape) {
  :root[data-layout="tablet"] #challengeRoot[data-mode="endless"] .item-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
    padding-inline: 18px;
  }
}

:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-card[data-stage-focus="true"] {
  box-shadow: inset 0 0 0 2px rgba(255, 240, 192, 0.72);
}
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-card[data-danger="true"],
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-card[data-tier="T3"],
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-card[data-tier="T4"] {
  box-shadow: inset 0 0 0 1px rgba(240, 200, 120, 0.38);
}
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-card.max-restock,
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-grid.is-max-impacting > .item-card,
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-grid.is-max-sweeping > .item-card,
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .max-impact-ghost,
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .max-sweep-ghost {
  animation: none !important;
}
:root[data-layout="mobile"] #challengeRoot[data-mode="endless"] .item-grid.is-max-sweeping::after {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  #challengeRoot[data-mode="endless"] .item-card.max-restock,
  #challengeRoot[data-mode="endless"] .item-grid.is-max-impacting > .item-card,
  #challengeRoot[data-mode="endless"] .item-grid.is-max-sweeping > .item-card,
  #challengeRoot[data-mode="endless"] .item-grid.is-max-sweeping::after,
  #challengeRoot[data-mode="endless"] .max-impact-ghost,
  #challengeRoot[data-mode="endless"] .max-sweep-ghost,
  .max-gold-overlay,
  .max-gold-overlay__shine,
  .max-gold-overlay__timer i {
    animation: none;
  }
}

/* ===== css/app-shell-guard.css ===== */
/* iOS-app 化使用限制 · 引入顺序置末以保证覆盖优先级。
   分层原则:
   - 全端: 杀橡皮筋回弹、去点击灰高亮、去双击缩放延迟、禁图片拖拽。
   - 移动端(触屏): app 级锁定 —— 禁文本选中 / 禁长按呼出菜单; 输入与需复制文案的节点走白名单放行。
   - PC(有指针/可 hover): 保留网页规范, 文本仍可选中复制。 */

html, body {
  overscroll-behavior: none;                 /* 杀橡皮筋 / 下拉刷新 / 滚动链 */
}
html {
  /* 双击缩放防护根: 部分 Android 浏览器对 body 单独 manipulation 不生效,
     需 html 也声明; iOS Safari 则认 html > body 的层叠。 */
  touch-action: manipulation;
}
body {
  -webkit-tap-highlight-color: transparent;  /* 去移动端点击灰色高亮 */
  touch-action: manipulation;                /* 去双击缩放 + 300ms 点击延迟 */
}

/* 图片 / SVG 禁拖拽 (长按拖出/存图观感更像原生) */
img, svg {
  -webkit-user-drag: none;
  user-drag: none;
}

/* ─── 移动端 = app 级锁定 ─── */
@media (hover: none), (pointer: coarse) {
  /* 双击缩放兜底: 业务 css (challenge/endless-draw/styles) 里散落 touch-action:pan-y 会
     覆盖 body 的 manipulation, 让双击缩放在 .item-card / .shop / .item-grid 复活。
     触屏端统一升回 manipulation: 平移手势不受影响, 双击缩放/双指缩放被根绝。 */
  * {
    touch-action: manipulation;
    -webkit-touch-callout: none;   /* 禁长按呼出系统菜单(拷贝/查询/分享) */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  /* dialog top layer 兜底: iOS Safari 对 showModal 后的 dialog 独立渲染,
     * 通配的 manipulation 不一定命中 top layer, 显式点名 (部分版本有效, 无效也无害,
     真正的拦截在 js/app-guard.js 的 dialog 级 gesturestart/touchstart 监听)。 */
  dialog, dialog * {
    touch-action: manipulation;
  }
  /* 白名单: 输入框与需要选中/复制的文案节点仍可操作 */
  input, textarea, [contenteditable="true"],
  .hero-pill__input, #nameInput,
  .share-dialog__subtitle {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
  }
}
