
/* Match detail */
.match-detail-page { display: grid; width: min(100%, 1180px); min-width: 0; gap: 16px; margin: 0 auto; }
.match-detail-hero { padding: 20px; overflow: hidden; }
.match-detail-heading { gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.match-detail-heading h1 { margin: 6px 0 0; font-size: 27px; }
/* 标题区只有一行:赛事标志 + 赛事名,可点击进入该赛事。 */
.match-series-link { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.match-series-link:hover { color: var(--text); }
.match-series-mark { width: 22px; height: 22px; border-radius: var(--radius-xs); }
.match-series-mark img { object-fit: cover; }

.match-detail-versus { grid-template-columns: minmax(180px, 1fr) 150px minmax(180px, 1fr); gap: 24px; min-height: 190px; padding: 20px 4px 8px; }
.match-detail-team { display: grid; justify-items: center; gap: 8px; min-width: 0; text-align: center; }
/* 队徽队名整块可点，进这支队伍的页面。 */
.match-detail-team-link { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.match-detail-team-link:hover strong { color: var(--lime); }
.match-detail-team-logo { width: 78px; height: 78px; border-radius: var(--radius-lg); border: 1px solid transparent; font-size: 22px; }
.match-detail-tbd { display: inline-grid; place-items: center; color: var(--muted); background: var(--panel-soft); border: 1px dashed var(--line-light); font-weight: 800; }
.match-detail-team strong { max-width: 100%; font-size: 18px; }
.match-detail-team > span:last-child { color: var(--muted); font-size: 10px; }
.match-detail-score { display: grid; justify-items: center; }
/* 比分与 VS：和比赛长条同一套——无衬线、字重更大，数字等宽。
   32px 在一张 1300px 宽的 hero 里比例偏小，看不到"这就是这场的结果"，所以提到 48px
   （窄屏那一档在 `8-responsive.css` 里同步从 20px 提到 28px）。 */
.match-detail-score strong { white-space: nowrap; font-family: Manrope, "Microsoft YaHei", sans-serif; font-size: 48px; font-weight: 800; font-variant-numeric: tabular-nums; }
.match-detail-facts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.match-detail-facts > div { display: grid; gap: 6px; min-width: 0; border-right: 1px solid var(--line); }
.match-detail-facts > div:last-child { border-right: 0; }
.match-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 255px; align-items: start; gap: 16px; }
.match-detail-main, .match-detail-aside { display: grid; gap: 16px; min-width: 0; }
.match-rosters, .match-statistics, .match-maps, .match-context-panel, .match-source-panel { min-width: 0; }
.match-section-head { gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.match-section-head h2, .match-context-panel h2, .match-source-panel h2 { margin: 0; font-size: 13px; }
/* 说明文字用 9px 等宽（比全局的 `.section-note` 小一号，因为这里和标题同一行）。
   第二个选择器是给包了 `.match-section-actions` 之后的说明用的 —— 它不再是
   `.match-section-head` 的直接子元素，漏掉这一条说明会悄悄变成 10px。 */
.match-section-head > span, .match-section-actions > span { color: var(--muted); font: 9px "DM Mono", monospace; }
.match-filter-group { display: inline-flex; align-items: center; gap: 4px; }
.match-side-filters { margin-top: 8px; }
.match-map-filters { margin-left: auto; }
.match-filter-btn { border: 1px solid var(--line); border-radius: var(--radius-pill); background: transparent; padding: 4px 10px; cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease; }
.match-filter-btn:hover { color: var(--text); border-color: var(--line-light); }
.match-filter-btn.active { color: var(--text); border-color: var(--coral); background: color-mix(in srgb, var(--coral) 14%, transparent); }
.match-roster-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.match-roster-team { min-width: 0; }
.match-roster-team + .match-roster-team { padding-left: 20px; border-left: 1px solid var(--line); }
.match-roster-title { gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.match-roster-title strong { font-size: 11px; }
.match-roster-team-logo { width: 28px; height: 28px; border-radius: var(--radius-input); font-size: 9px; }
.match-roster-list { display: grid; gap: 4px; padding-top: 8px; }
.match-roster-player { min-height: 32px; padding: 2px 4px; }
.match-roster-player span { font-size: 10px; font-weight: 700; }
.match-roster-avatar, .match-stat-avatar { width: 24px; height: 24px; border-radius: var(--radius-input); font-size: 9px; }
.match-roster-empty, .match-source-empty { padding: 16px 4px; color: var(--muted); font-size: 10px; }
.match-context-panel dl { display: grid; gap: 0; margin: 12px 0 0; }
.match-context-panel dl > div { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.match-context-panel dl > div:last-child { border-bottom: 0; }
.match-context-panel dt { color: var(--muted); font-size: 9px; }
.match-context-panel dd { margin: 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 700; }
.match-source-panel { display: grid; gap: 8px; }
.match-source-row { display: grid; gap: 4px; padding: 10px; border-left: 2px solid var(--lime); background: var(--panel-raised); }
/* 能跳到来源比赛的那几条用按钮渲染，形状与不可点的完全一致，只多了悬停反馈。 */
button.match-source-row { width: 100%; border: 0; border-left: 2px solid var(--lime); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .16s ease; }
button.match-source-row:hover { border-left-color: var(--text); }
.match-source-row span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.match-source-row strong { font-size: 10px; }
/* 手动指定的来源指向了一个已经不在赛程里的节点。照实显示，但去掉那条强调色的左边框 ——
   它已经不是一条能走的路径了，画得和有效来源一样会让人以为它还在生效。 */
.match-source-row.is-missing { border-left-color: var(--line); }
.match-source-row.is-missing span { text-decoration: line-through; }
/* 轮空也是一条**有效**来源，所以边框还是强调色 —— 但用虚线：它背后没有一场能点进去的
   比赛。实线会让人以为点得开。 */
.match-source-row.is-bye { border-left-style: dashed; }
.match-statistics, .match-duels, .match-maps { min-width: 0; max-width: 100%; overflow: hidden; }
.match-stat-table { display: block; }
.match-stat-team { width: 100%; min-width: 560px; border: 1px solid var(--line); border-radius: var(--radius-btn); overflow: hidden; }
.match-stat-team + .match-stat-team { margin-top: 10px; }
.match-stat-head, .match-stat-row { display: grid; grid-template-columns: minmax(150px, 1fr) repeat(5, minmax(54px, 76px)); align-items: center; gap: 8px; }
.match-stat-head { padding: 8px 10px; color: var(--text); background: var(--panel-raised); }
.match-stat-head > strong { min-width: 0; font-size: 11px; }
.match-stat-head > strong > span:last-child { color: var(--text); text-align: left; font: inherit; }
/* 数据面板里的头像+名字可点进各自页面。
   队伍表头原本是 `<strong>`：11px、粗体，名字靠 `font: inherit` 跟着。换成按钮后这些
   全部失效——按钮有自己的 UA 字号，`font: inherit` 又把它换成父级字号，名字于是变成
   常规体的大字。所以这里按"逐条写回来"处理，并且让按钮那条的优先级高于下面的重置。 */
.match-stat-person, .match-stat-team-link { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.match-stat-team-link > span:last-child { min-width: 0; color: var(--text); font: inherit; text-align: left; }
button.match-stat-person, button.match-stat-team-link { padding: 0; border: 0; background: transparent; color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
button.match-stat-person { font: inherit; }
button.match-stat-team-link { font-size: 11px; font-weight: 700; }
button.match-stat-person:hover strong, button.match-stat-team-link:hover > span:last-child { color: var(--lime); }
.match-stat-team-logo { width: 24px; height: 24px; border-radius: var(--radius-input); flex: 0 0 24px; font-size: 9px; }
.match-stat-head > div { display: contents; }
.match-stat-head > div > span { color: var(--muted); text-align: right; font: 9px "DM Mono", monospace; }
.match-stat-row { min-height: 42px; padding: 6px 10px; border-top: 1px solid var(--line); font: 9px "DM Mono", monospace; }
.match-stat-row > span { color: var(--muted); text-align: right; }

.match-stat-row .match-stat-kills, .match-stat-head .match-stat-kills { color: var(--text); font-weight: 800; }
.match-stat-player { min-width: 0; font-family: Manrope, "Microsoft YaHei", sans-serif; }
.match-stat-player strong { font-size: 10px; }
.match-duels { padding: 18px; }
.match-duels .match-section-head { margin-bottom: 12px; }
/* The duel matrix is `width: max-content` by design -- columns must not be squeezed --
   so this is the horizontal scroller the project's wide-table rule asks for. Without
   it the panel's `overflow: hidden` silently cut the right-hand columns off. */
.duel-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); }
.duel-grid { display: grid; grid-template-columns: minmax(164px, 1.2fr) repeat(var(--duel-columns), minmax(112px, 1fr)); width: max-content; min-width: 100%; background: var(--panel); }
.duel-grid > div { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.duel-corner, .duel-head { min-height: 76px; background: var(--panel-raised); }
.duel-corner { display: grid; align-content: center; gap: 4px; padding: 10px 12px; }
.duel-corner strong { font-size: 10px; }
.duel-corner span { color: var(--muted); font: 9px "DM Mono", monospace; }
.duel-head { display: grid; place-items: center; padding: 8px; }
.duel-row-head { min-height: 68px; padding: 8px 12px; background: color-mix(in srgb, var(--panel-raised) 72%, var(--panel)); }
.duel-player { min-width: 0; }
.duel-player-compact { display: grid; justify-items: center; gap: 4px; text-align: center; }
.duel-avatar { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; font-size: 9px; }
.duel-player strong { font-size: 10px; }
.duel-player-compact strong { max-width: 100%; font-size: 9px; }
.duel-cell { display: grid; min-height: 68px; place-items: center; background: color-mix(in srgb, var(--panel) 88%, var(--duel-tint)); }
.duel-cell.duel-left-win { background: linear-gradient(115deg, color-mix(in srgb, var(--lime) 13%, var(--panel)), var(--panel)); }
.duel-cell.duel-right-win { background: linear-gradient(245deg, color-mix(in srgb, var(--lime) 13%, var(--panel)), var(--panel)); }
.duel-cell > strong { display: flex; align-items: baseline; gap: 6px; font: 20px "DM Mono", monospace; }
.duel-cell b { color: var(--text); font-weight: 800; }
.duel-cell b.winner { color: var(--lime); }
.duel-cell i { color: var(--muted-2); font-style: normal; font-weight: 400; }
/* 地图卡永远排成**一行**。原来用 auto-fit + minmax，装不下就折行——同一场比赛的地图
   于是有的在第一行、有的掉到第二行，高度还参差。改成定列数的横向流：装不下就横向滚动，
   卡片高度靠 stretch 自动对齐。 */
.match-map-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.match-map-card { position: relative; isolation: isolate; display: grid; align-content: start; gap: 8px; min-width: 0; min-height: 164px; overflow: hidden; padding: 12px 12px; border-right: 1px solid var(--line); background: var(--panel-raised); }
/* 底图：只做很轻的虚化，保留一点地图肌理。原来的 9px 把图糊成一团色块，
   既看不出是哪张图，也没有层次。 */
.match-map-card::before { content: ""; position: absolute; z-index: -2; inset: -8px; background: var(--map-image, none) center/cover no-repeat; filter: blur(3px) saturate(1.02); opacity: .62; transform: scale(1.04); }
/* 遮罩用 --ink 而不是 --panel：这是**一张照片**，所以两套主题下都该压暗。
   用主题表面色的话，亮色主题会变成"加白"，把地图冲淡、近白的比分也糊在里头
   ——这正是亮色下看不清的原因。压暗之后比分与右下角水印在两种主题里都可读。 */
.match-map-card::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 48%, transparent), color-mix(in srgb, var(--ink) 16%, transparent)); }
.match-map-card > * { position: relative; }
.match-map-card.match-map-pending::before { display: none; }
.match-map-card:last-child { border-right: 0; }
/* 比分靠左上，其余内容自然排在下方。 */
.match-map-card.has-map { grid-template-rows: auto minmax(0, 1fr) auto; align-content: start; justify-items: start; }
.match-map-score { justify-content: flex-start; gap: 8px; min-height: 0; }
/* 败方略退、胜方用灰绿点出——层次来自明度差，而不是把胜方调亮。 */
.match-map-score b { color: color-mix(in srgb, var(--score-text) 70%, transparent); font-family: Manrope, "Microsoft YaHei", sans-serif; font-size: clamp(26px, 2.1vw, 32px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.01em; text-shadow: 0 2px 12px color-mix(in srgb, var(--ink) 42%, transparent); }
.match-map-score b.winner { color: var(--score-win); text-shadow: 0 2px 12px color-mix(in srgb, var(--score-glow) 26%, transparent); }
.match-map-score i { width: auto; color: color-mix(in srgb, var(--snow) 62%, transparent); font-family: Manrope, "Microsoft YaHei", sans-serif; font-size: 20px; font-style: normal; font-weight: 500; line-height: 1; text-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 34%, transparent); }
/* 地图名水印：右下角、全大写、极低对比——是背景层次而不是信息，所以 aria-hidden。 */
.match-map-name { position: absolute; right: 12px; bottom: 6px; max-width: 84%; overflow: hidden; color: color-mix(in srgb, var(--snow) 14%, transparent); font-family: Manrope, "Microsoft YaHei", sans-serif; font-size: clamp(26px, 2.6vw, 40px); font-weight: 800; letter-spacing: .01em; line-height: 1; white-space: nowrap; pointer-events: none; user-select: none; }
.match-map-upload { display: grid; gap: 6px; margin-top: 4px; }
/* 未打的地图槽：先选图，再（可选）上传 demo。 */
.match-map-pick { display: grid; gap: 4px; }
.match-map-pick > span { color: var(--muted); font: 9px "DM Mono", monospace; }
.match-map-pick select { padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius-input); background: var(--panel-raised); color: var(--text); font: 10px "DM Mono", monospace; }
/* --:-- 要比真比分弱：它是"还没有"，不是"比分很小"。 */
.match-map-score-empty b { color: var(--muted-2); font-size: 22px; }
.match-map-score-empty i { color: var(--muted-2); }
.match-upload-binding { gap: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
/* 选中的地图卡：主色描边要够粗才看得见——1px 在地图这种花背景上几乎读不出来。 */
.match-map-card.is-selected { box-shadow: inset 0 0 0 2px var(--lime); }
.match-map-card[data-action="select-round-map"] { cursor: pointer; }
/* 卡片内的段落：与上方地图行用一条淡分隔线隔开，而不是各自成卡。 */
.match-rounds { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
/* 回合轨道：左列是队伍标记，之后每个回合一列——**固定列宽**。
   用 1fr 会让只有 4 个回合的加时段把格子撑成巨块（`aspect-ratio:1` 还会顺带把它变得很高），
   所以这里给死尺寸，宁可右侧留白。两行用同一套列宽，同号回合必在同一列。
   行宽取 max-content、由轨道自己横向滚动：24 个回合在窄屏上可滚动，而且**两行共用
   同一个滚动容器**——各滚各的会让上下两行错位。 */
.round-track { display: grid; gap: 6px; overflow-x: auto; overflow-y: hidden; }
.round-row { grid-template-columns: 22px; grid-auto-flow: column; grid-auto-columns: 22px; gap: 4px; width: max-content; }
.round-mark-avatar { width: 22px; height: 22px; border-radius: var(--radius-input); object-fit: cover; }
.round-cell { position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-xs); background: var(--panel-soft); }
.round-cell.is-empty { background: transparent; }
.round-cell svg { width: 14px; height: 14px; }
/* 换边的竖线：画在格子自己的伪元素上，落在列间隙里。
   两处踩过的坑：早先是一个独立的 span——它占掉一整个 22px 列（把后面的回合整体推移），
   而且 `height: 100%` 在行高为 auto 的网格项上按 auto 计算，高度 0，线根本画不出来；
   改成伪元素后仍然看不见，因为 `--line-light`(#3a424b) 压在深色面板上对比度太低
   ——用运行时注入 10px 鲜红版才确认它其实一直在画。所以这里用 `--muted-2`。 */
.round-cell[data-swap="1"]::before { content: ""; position: absolute; left: -3px; top: -3px; bottom: -3px; width: 2px; background: var(--muted-2); }
/* 颜色表示"赢的一方当时在哪一边"（与图标自身配色一致），不是表示哪支队伍——
   队伍由行位置区分（A 上 B 下）。 */
.round-cell[data-side="t"] { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.round-cell[data-side="ct"] { color: var(--sky); background: color-mix(in srgb, var(--sky) 14%, transparent); }
/* 比赛数据的标题与两组筛选同处一行：阵营筛选紧跟标题，地图筛选推到最右。 */
.match-statistics .match-section-head { gap: 10px; }
.match-statistics .match-map-filters { margin-left: auto; }
.match-upload-binding select { min-width: 42px; padding: 2px 2px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--panel-raised); color: var(--text); font: 9px "DM Mono", monospace; }
.demo-binding-targets { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 14px 0; }
.demo-binding-targets > div { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-input); background: var(--panel-raised); }
.demo-binding-targets span, .demo-team-preview-head span, .demo-binding-select > span { color: var(--muted); font-size: 9px; }
.demo-binding-targets strong { font-size: 12px; }
.demo-team-previews { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 12px 0 16px; }
.demo-team-preview { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-btn); }
.demo-team-preview-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.demo-team-preview-head strong { font: 12px "DM Mono", monospace; }
.demo-team-preview-list { display: grid; gap: 4px; padding-top: 8px; }
.demo-team-preview-list > span { gap: 6px; min-width: 0; font-size: 10px; }

.demo-team-preview-list em { color: var(--muted); font-size: 9px; font-style: normal; }
.demo-team-preview-avatar { width: 20px; height: 20px; border-radius: var(--radius-input); font-size: 9px; flex: 0 0 auto; }
.demo-binding-select { display: grid; gap: 6px; }
.match-map-upload input[type="file"] { min-width: 0; max-width: 100%; color: var(--muted); font-size: 9px; }
.match-map-upload .tiny-btn { justify-self: start; padding: 4px 6px; }
.match-map-pending { opacity: .65; }

/* Room drawer */
.overlay { position: fixed; inset: 0; z-index: 20; background: var(--scrim-drawer); display: flex; align-items: flex-start; justify-content: flex-end; padding: 18px; }

.drawer-close { border: 0; background: transparent; color: var(--muted); padding: 0; font-size: 24px; line-height: 1; }
.room-status { color: var(--lime); font: 10px "DM Mono", monospace; text-transform: uppercase; margin-top: 6px; }

.side-label { color: var(--lime); margin: 10px 0 6px; }

.slots { display: grid; gap: 6px; }
.slot { gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-input); color: var(--muted); background: var(--surface-slot); font-size: 10px; }
.slot.filled { color: var(--text); }
.slot.empty { border-style: dashed; color: var(--muted-2); }
.slot-avatar { width: 23px; height: 23px; border-radius: var(--radius-input); object-fit: cover; background: var(--slot-avatar-bg); }
/* 房间的空位里套了一层头像：外层 23px、内层沿用 `.avatar` 的 29px，于是右边溢出 6px 被裁掉。
   让内层填满外层即可——不靠改标记。 */
.slot-avatar .avatar { width: 100%; height: 100%; }
.slot-name { flex: 1; }
.slot-tag { color: var(--muted-2); font: 9px "DM Mono", monospace; }

.side-card { min-width: 0; }
.side-card h3 { margin-bottom: 10px; font-size: 13px; }
.side-card p { color: var(--muted); font-size: 10px; line-height: 1.55; }
.side-card .primary-btn, .side-card .secondary-btn { width: 100%; margin-top: 12px; }
/* 房间名单表单：两个下拉加一个按钮，宽度跟着侧栏走。按钮的上边距由 .field 的
   间距承担，所以这里不要再叠一层。 */
.room-join { display: grid; }
.room-join .field { margin-bottom: 10px; }
.room-join .primary-btn { margin-top: 0; }
.switch-row { color: var(--muted); font-size: 10px; }
.switch { width: 31px; height: 18px; position: relative; border-radius: var(--radius-pill); border: 0; background: var(--surface-switch); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: var(--switch-knob); border-radius: 50%; transition: .18s ease; }
.switch.on { background: var(--lime); }
.switch.on::after { left: 16px; background: var(--switch-knob-on); }
.integration { color: var(--muted); font: 9px "DM Mono", monospace; }
.integration-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }

/* Full-page match workspace */
.room-shell { min-height: 100vh; background: var(--bg); }
.room-screen { min-height: 100vh; display: flex; flex-direction: column; padding: 24px clamp(18px, 4vw, 54px) 36px; }
.room-screen-head { gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.room-brand { min-width: 190px; }
.room-brand .brand-mark { width: 32px; height: 32px; }
.room-brand .brand-name { font-size: 15px; }
.room-context { flex: 1; min-width: 0; }
.room-context h1 { font-size: clamp(19px, 2.5vw, 27px); margin-top: 2px; }
.room-context .room-status { margin-top: 6px; }
.room-head-actions { gap: 12px; }
.room-head-actions .integration { white-space: nowrap; }
.room-screen-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; margin-top: 20px; }
.room-board { min-height: 0; display: flex; flex-direction: column; padding: clamp(18px, 3vw, 30px); }
.room-board-meta { gap: 14px; }
.room-board-meta strong { margin-left: 10px; color: var(--text); font: 12px "DM Mono", monospace; }
.room-map-chip { padding: 6px 8px; color: var(--lime); border: 1px solid color-mix(in srgb, var(--lime) 45%, var(--line)); border-radius: var(--radius-input); }

.room-spectators { margin-top: auto; padding-top: 20px; }
.room-spectators .side-label { margin-top: 0; }
.room-spectators .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.room-control-column { display: grid; align-content: start; gap: 12px; }
.picker-list { display: grid; gap: 6px; max-height: 170px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--panel-soft); }
.picker-search { width: 100%; margin-bottom: 6px; padding: 8px 10px; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-input); outline: 0; background: var(--panel-soft); font-size: 11px; }
.picker-search:focus { border-color: var(--lime); }
/* 选择列表的一行：复选框在左，名字紧随其后占满剩余宽度。
   必须用 `.picker-list .picker-item`：这个 <label> 位于 `.field` 内，而 `.field label`
   的特异性（0,1,1）高于 `.picker-item`（0,1,0），会把 muted / 10px / 700 那套表单
   标签样式盖上来，于是名字又小又灰、位置还被挤到右边。 */
.picker-list .picker-item { padding: 6px 8px; border-radius: var(--radius-input); color: var(--text); background: var(--panel); font-size: 12px; font-weight: 400; }
/* 复选框必须显式定尺寸：`.field input { width: 100% }` 会把它撑满整行，于是名字被挤成
   0 宽，而勾选框因为在自己的宽盒子里居中绘制，看起来"悬在中间"。
   `.picker-list .picker-item > input` 的特异性（0,2,1）高于 `.field input`（0,1,1）。 */
.picker-list .picker-item > input { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; }
.picker-list .picker-item > span { flex: 1 1 auto; min-width: 0; text-align: left; }
/* 选手 / 替补 切换：小胶囊，点一下翻转。 */
.picker-role { flex: 0 0 auto; padding: 2px 8px; border: 1px solid var(--line-light); border-radius: var(--radius-xs); color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; transition: border-color .16s ease, color .16s ease; }
.picker-role:hover { border-color: var(--lime); color: var(--text); }
.picker-role.is-sub { border-color: var(--yellow); color: var(--yellow); }
.picker-item:hover { background: var(--panel-raised); }
.picker-item input { accent-color: var(--lime); }
.picker-hint { color: var(--muted); font-size: 10px; line-height: 1.5; }
.history-list { display: grid; gap: 8px; max-height: 420px; overflow: auto; }

/* Demo 下载卡片：在「赛程」卡片上面,给这场比赛的 demo 一个打包下载入口。 */
.match-demo-panel h2 { margin: 0; }
.match-demo-note { margin: 10px 0 12px; color: var(--muted); font-size: 11px; }

/* 胜率预测卡片。侧栏只有 255px,所以两个选项竖着排:横排会把队名压成一个字一列。 */
.match-prediction-panel h2 { margin: 0; }
.match-prediction-note { margin: 10px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.prediction-choices { display: grid; gap: 8px; }
.prediction-choice { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-card); color: var(--text); background: var(--surface-control); text-align: left; font-size: 12px; font-weight: 700; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.prediction-choice:hover:not(:disabled) { border-color: var(--lime); background: var(--surface-hover); }
/* 选中的那一侧是"就是这个",不是禁用态:用主色描边和淡底,不要用透明度,
   否则"已选择"看起来和"不可选择"一模一样。 */
.prediction-choice.is-picked { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 14%, transparent); }
.prediction-choice:disabled { cursor: not-allowed; }
.prediction-choice.is-closed:not(.is-picked), .prediction-choice:disabled:not(.is-picked) { opacity: .55; }
.prediction-choice-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prediction-choice-tag { flex: 0 0 auto; color: var(--muted); font: 10px "DM Mono", monospace; }
.prediction-choice.is-picked .prediction-choice-tag { color: var(--lime); }
.prediction-verdict { margin: 12px 0 0; font-size: 11px; line-height: 1.55; }
.prediction-verdict.is-correct { color: var(--win); }
.prediction-verdict.is-wrong { color: var(--coral); }
/* 票数条：左右两段，A 队在左（蓝）、B 队在右（红）。
   上下排布时两队的名字被中间那条隔开，读者得来回找哪个数字属于谁；左右排布时名字就在
   自己那一段旁边。宽名字用 `min-width: 0` + 截断收住，不做换行 —— 换行会让两段不再对齐。 */
.prediction-tally { margin-top: 14px; }
/* 队名一行，左蓝右红各占一边。这里原先还跟着 `N 人` 的票数，去掉了 ——
   票数在该看的地方（条上的比例、下面那句参与人数）都有，而它把队名挤成一截一截的省略号。 */
.prediction-tally-sides { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 700; }
.prediction-tally-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prediction-tally-name.is-b { text-align: right; }
/* 比例条。8px 太细（写不进东西也看不出差别），26px 是加高之后定下来的尺寸。
   26 → 34 → 44 → 56 那几轮是**误改**：那几次"加大一点 / 再大点"说的是上面的比分，
   不是这条比例条，所以都退回来了。 */
.prediction-tally-bar { position: relative; display: flex; height: 26px; margin-top: 7px; border-radius: var(--radius-input); background: var(--track); overflow: hidden; }
.prediction-tally-bar > span { display: block; height: 100%; }
/* 两段的颜色是**数据编码**，所以定义成固定的 `--tally-a` / `--tally-b`（见 1-tokens.css），
   不跟随「网站管理 → 特征色」。 */
.prediction-tally-bar > .is-a { background: var(--tally-a); }
.prediction-tally-bar > .is-b { background: var(--tally-b); }
/* 比例写在条的**两端内侧**，白色无衬线字体（不是等宽 —— 这里要的是"看得清的数字"，
   不是"对齐的数字"）。放两端而不是各段内部：5% 的那一段只有十几像素，装不下"5%"。
   竖直居中用 `top:0; bottom:0` + flex，不用 `top:50%` + `translateY(-50%)` ——
   后者居中的是**行盒**，而行高是 `normal`，字形的光学中心比行盒中心低一点，看起来就是偏下。
   没有 text-shadow：底色已经够深，白字对比度 4.9:1，那圈黑边只会让数字发糊。 */
.prediction-tally-pct { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; line-height: 1; color: var(--text); font: 700 12px Manrope, "Microsoft YaHei", sans-serif; }
.prediction-tally-pct.is-a { left: 10px; }
.prediction-tally-pct.is-b { right: 10px; }
.prediction-tally .match-prediction-note { margin: 10px 0 0; }
/* 预测卡片头部的右侧：一句状态说明 + 管理页才有的设置入口。包一层是为了让
   `.match-section-head` 的 `space-between` 只分两堆（标题 | 说明+按钮），
   不然三段内容会把说明挤到正中间。 */
.match-section-actions { display: inline-flex; align-items: center; gap: 10px; }
.match-demo-download { display: block; text-align: center; text-decoration: none; }
/* 还没打包好:禁用,不是在忙。通用的 :disabled 写着 cursor: wait,那会让人以为
   "正在下载,等一下就好",而其实要等比赛出胜方才会打包。 */
.match-demo-download:disabled { opacity: .45; cursor: not-allowed; }
.match-demo-pending { margin: 8px 0 0; }
/* 打包进度:细条。填充宽度是真实进度(每装完一张图推进一格),
   而"还在动"的斜纹画在**轨道**上而不是填充上 —— 否则第一张图压到一半时
   填充还是 0,整条看起来像卡死了(用户就是这么反馈的)。 */
.match-demo-progress { position: relative; height: 3px; margin: 10px 0 0; overflow: hidden; border-radius: var(--radius-pill); background: var(--panel-soft); }
.match-demo-progress > span { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--lime); transition: width .3s ease; }
.match-demo-progress::after {
  content: ''; position: absolute; inset: 0; opacity: .55;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  animation: demo-progress-sheen 1.4s linear infinite;
}
@keyframes demo-progress-sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .match-demo-progress::after { animation: none; opacity: 0; }
}
