:root {
  --bg: #10131a;
  --bg-soft: #161a24;
  --panel: #1c2130;
  --panel-2: #232939;
  --line: #2e3648;
  --line-soft: #262d3d;
  --text: #e8ecf5;
  --text-dim: #9aa4bb;
  --text-faint: #667089;
  --gold: #e8b563;
  --gold-dim: #a67f3c;
  --green: #5fbf8f;
  --red: #e06b6b;
  --blue: #5c9dd6;
  --purple: #8b7fd4;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.screen { display: none; height: 100%; }
.screen.active { display: flex; flex-direction: column; }

/* ---------------- 主菜单 ---------------- */
#menu {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
}

.menu-card {
  width: 736px;
  max-width: calc(100vw - 32px);
  margin: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 26px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

/* ---------------- 主菜单：把「拼布」这两个字本身做成拼布 ----------------
   每个字坐一枚布片：斜纹布底 + 四周一圈虚线缝脚 + 投影，两块微微错开角度，
   像真的缝在一起。下面再配一条拼布带、一颗纽扣、一只砂漏。
   全部纯 CSS —— 不引图片、不引字体文件，任何机器上渲染结果都一样。 */
.brand { position: relative; padding-top: 2px; }

.title {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0;
}
.tile {
  position: relative;
  flex: none;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  color: #fff3d4;
  border-radius: 11px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, .6);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -3px 8px rgba(0, 0, 0, .35);
}
/* 布片四周那圈虚线针脚 */
.tile::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px dashed rgba(255, 245, 220, .42);
  border-radius: 7px;
  pointer-events: none;
}
.t1 {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .075) 0 4px, transparent 4px 8px),
    linear-gradient(150deg, #d8a24a, #a4641f 72%);
  transform: rotate(-2.5deg);
}
.t2 {
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .075) 0 4px, transparent 4px 8px),
    linear-gradient(150deg, #b57ad8, #6a4a9e 72%);
  transform: rotate(2deg);
}

/* 标题下面那排小装饰：纽扣 — 拼布带 — 砂漏 */
.brand-deco {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 304px;
  max-width: 100%;
  margin: 12px auto 0;
}
/* 一条拼布带：几块不同花色的布拼成一行，上下各缝一道虚线 */
.quilt-strip {
  flex: 1;
  height: 14px;
  border-radius: 3px;
  border-top: 1px dashed rgba(255, 245, 220, .3);
  border-bottom: 1px dashed rgba(255, 245, 220, .3);
  background: repeating-linear-gradient(90deg,
    #d8a24a 0 18px, #8f6fd0 18px 36px, #5fbf8f 36px 54px,
    #5c9dd6 54px 72px, #e06b6b 72px 90px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28);
  opacity: .88;
}
/* 一颗纽扣：金属底 + 四个线孔 */
.deco-btn {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffedb8, #d8a13a 58%, #7d5416);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .5), inset 0 -2px 4px rgba(0, 0, 0, .3);
}
.deco-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image:
    radial-gradient(circle at 7px 7px, rgba(0, 0, 0, .62) 1.2px, transparent 1.7px),
    radial-gradient(circle at 13px 7px, rgba(0, 0, 0, .62) 1.2px, transparent 1.7px),
    radial-gradient(circle at 7px 13px, rgba(0, 0, 0, .62) 1.2px, transparent 1.7px),
    radial-gradient(circle at 13px 13px, rgba(0, 0, 0, .62) 1.2px, transparent 1.7px);
}
/* 一只砂漏：两个尖对尖的三角，跟补丁卡上那个时间图标同款 */
.deco-hourglass {
  position: relative;
  flex: none;
  width: 18px;
  height: 20px;
}
.deco-hourglass::before,
.deco-hourglass::after {
  content: '';
  position: absolute;
  left: 1px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}
.deco-hourglass::before { top: 0; border-top: 10px solid var(--gold); }
.deco-hourglass::after { bottom: 0; border-bottom: 10px solid var(--gold); }

/* 主菜单里把大区块切开的粗线：一条实心带压着一排金色缝脚 */
.menu-rule {
  position: relative;
  height: 3px;
  margin: 11px 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--line) 5%, var(--line) 95%, transparent);
}
.menu-rule::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background-image: repeating-linear-gradient(90deg,
    rgba(232, 181, 99, .5) 0 6px, transparent 6px 13px);
}

.menu-top {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 0;
}
.menu-top .field { flex: 1; min-width: 0; margin-bottom: 0; }

/* 音效开关：主菜单和对局页各一个，长一个样 */
.sfx-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 12px 12px;
  cursor: pointer;
  transition: border-color .14s, color .14s, background .14s;
}
.sfx-btn:hover { border-color: var(--gold-dim); background: #202636; }
.sfx-btn .sfx-ico { position: relative; font-size: 15px; display: inline-block; }
/* 关掉时给音符划一道斜杠 —— 比单纯变灰更容易一眼看出状态 */
.sfx-btn.off { color: #5f6880; }
.sfx-btn.off .sfx-ico::after {
  content: '';
  position: absolute;
  left: -2px; right: -2px;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transform: rotate(-24deg);
}
.sfx-btn.compact { padding: 7px 9px; font-size: 11px; }
.sfx-btn.compact .sfx-ico { font-size: 13px; }

/* ---------------- 主菜单：单机 / 联机左右并排 ---------------- */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
  align-items: start;
}
.menu-grid .menu-sec { margin-top: 0; padding-top: 0; border-top: none; }
.menu-grid .menu-sec + .menu-sec {
  /* 两栏之间的分隔也用粗线，跟横向的 .menu-rule 呼应 */
  border-left: 2px solid var(--line);
  padding-left: 22px;
}

/* v1.7：主菜单的「魔改版」分组与入口已整体下架，
   .variant-head / .vh-tag / .vh-sub / .variant-row / .mode-card.chaos 一并移除。 */

.variant-hint {
  margin: 9px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-faint);
}

/*
 * 经典版 = 金调（v1.6.1 起）。
 * 原本魔改版紫底紫边、比经典版还抢眼；v1.6.1 对调成经典版金底金边金字。
 * v1.7 魔改版入口下架后，金调就是唯一的主卡样式。
 */
.mode-card.classic {
  background: linear-gradient(150deg, #2b2418, #1b1e29 62%);
  border-color: var(--gold-dim);
}
.mode-card.classic:hover {
  border-color: var(--gold);
  background: linear-gradient(150deg, #342b1c, #202531 62%);
}
.mode-card.classic b { color: var(--gold); }


.menu-sec {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
/* 第一段（单机）紧跟在名字下面，不需要再画一条线 */
.menu-sec:first-of-type { margin-top: 4px; padding-top: 0; border-top: none; }

.sec-title {
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.mode-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 15px;
  margin-bottom: 9px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .08s;
}
.mode-card:hover { border-color: var(--gold-dim); background: #202636; }
.mode-card:active { transform: translateY(1px); }
.mode-card b { display: block; font-size: 15px; font-weight: 600; }
.mode-card small { display: block; margin-top: 3px; font-size: 12px; color: var(--text-faint); }

/* 菜单里「标签 + 输入 + 按钮」挤一行 */
.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.inline-field > span {
  flex: none;
  width: 58px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.inline-field select,
.inline-field input[type="text"] { flex: 1; min-width: 0; }
.inline-field .btn { flex: none; }
.inline-field input[type="text"] { padding: 9px 11px; font-size: 14px; }

select {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
select:focus { border-color: var(--gold-dim); }
select option { background: var(--panel); color: var(--text); }

.menu-foot {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 0;
}
/* 底部这两个按钮刻意做得比 .tiny 大 —— 「规则与图例」得一眼能看见 */
.menu-foot .btn { min-width: 132px; padding: 9px 18px; font-size: 13.5px; }

/* 主菜单里那条「让朋友打开这个地址」—— 以前只印在 PowerShell 里 */
.net-hint {
  background: #17202f;
  border: 1px solid #2b4155;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  margin-bottom: 10px;
}
.nh-label { font-size: 11.5px; color: var(--text-dim); margin-bottom: 6px; }
.nh-row { display: flex; align-items: center; gap: 8px; }
.nh-row code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  color: var(--gold);
  background: #0f141d;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

/* 标题的样式在上面的「主菜单：标题的艺术字」一节里，这里不再重复定义 */

.subtitle {
  margin: 11px 0 0;
  text-align: center;
  color: var(--text-faint);
  letter-spacing: .16em;
  font-size: 12px;
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: .06em;
}

input[type="text"] {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 13px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
input[type="text"]:focus { border-color: var(--gold-dim); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .14s, border-color .14s, transform .08s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #2a3145; border-color: #3b4560; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
/* 金色主按钮禁用时也要明显变灰，否则看着像能点 */
.btn.primary:disabled {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text-faint);
  opacity: .55;
}
.btn.primary {
  background: linear-gradient(180deg, #e8b563, #c99245);
  border-color: #d9a04f;
  color: #2a1e08;
  font-weight: 600;
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f0c072, #d49c4c); }
.btn.big { width: 100%; padding: 12px; font-size: 15px; }
.btn.tiny { padding: 5px 10px; font-size: 12px; }

kbd {
  display: inline-block;
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 15px;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
}

.divider {
  position: relative;
  text-align: center;
  margin: 20px 0 18px;
  color: var(--text-faint);
  font-size: 12px;
}
.divider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--line-soft);
}
.divider span { position: relative; background: var(--panel); padding: 0 12px; }

.msg { min-height: 18px; margin: 12px 0 0; font-size: 12.5px; color: var(--red); text-align: center; }
.msg.ok { color: var(--green); }
.hint { margin: 14px 0 0; font-size: 11.5px; color: var(--text-faint); line-height: 1.6; text-align: center; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
}
.room-tag {
  font-family: ui-monospace, monospace;
  letter-spacing: .18em;
  color: var(--gold);
  font-size: 13px;
}
.mode-tag {
  flex: none;
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
/* 魔改局：顶栏这个标签也换成紫的，一进对局就知道规则不一样 */
.mode-tag.chaos {
  color: #d9bdf0;
  border-color: #6a4f9a;
  background: rgba(143, 111, 208, .14);
}
.turn-tag {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}
.turn-tag.mine { color: var(--green); font-weight: 600; }
.turn-tag.wait { color: var(--text-faint); }
.topbar-actions { display: flex; gap: 8px; }

/* ---------------- 主区域 ---------------- */
.board-wrap {
  flex: 1;
  display: grid;
  /* 左边是所有人的拼布板，右边是市场/时间板/纪要 */
  grid-template-columns: minmax(0, 1fr) auto;
  /* 关键：把行高钉死成容器高度。
     不写这行的话 grid 行会按内容撑开，中间栏被拉到内容高度，
     日志框就跟着一起长高、永远不出滚动条，整页往下顶。 */
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  min-height: 0;
  overflow: hidden;
}

/* 拼布板区域：人数越多列越多，装不下时自己内部滚动 */
.players {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #3b4560 transparent;
}
.players::-webkit-scrollbar { width: 9px; }
.players::-webkit-scrollbar-thumb {
  background: #39435c;
  border-radius: 6px;
  border: 2px solid var(--bg);
}

.players .player-card { width: 100%; max-width: 400px; min-width: 0; }

/* 列数按人数排；3 人以上还要收一收卡片宽度，
   否则两行拼布板会顶出可视区，得滚动才看得全 */
.board-wrap[data-n="1"] .players { grid-template-columns: minmax(0, 1fr); }
.board-wrap[data-n="2"] .players { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.board-wrap[data-n="3"] .players { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board-wrap[data-n="4"] .players { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.board-wrap[data-n="5"] .players { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board-wrap[data-n="6"] .players { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.board-wrap[data-n="4"] .players .player-card,
.board-wrap[data-n="5"] .players .player-card,
.board-wrap[data-n="6"] .players .player-card { max-width: 276px; padding: 9px 10px 10px; }

.player-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
}
.player-card.me { border-color: #3d4763; }
.player-card.active { border-color: var(--gold-dim); box-shadow: 0 0 0 1px rgba(232,181,99,.22); }
.player-card.done { border-color: #2f5b48; }

/* 名字旁边那枚小标签：你 / 电脑 */
.pc-tag {
  flex: none;
  font-size: 10.5px;
  line-height: 16px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 7px;
}
.pc-tag.bot { color: var(--blue); border-color: #33506b; }
.pc-tag[hidden] { display: none; }

/* v1.6.7：电脑席位的难度徽章（挂在名字旁）。困难最醒目（金），普通蓝，轻松灰。 */
.pc-level {
  flex: none;
  font-size: 10.5px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 999px;
  padding: 0 7px;
  border: 1px solid var(--line);
  color: var(--text-faint);
  background: rgba(255, 255, 255, .03);
}
.pc-level.inline { margin-left: 6px; vertical-align: middle; }
.pc-level[data-level="hard"] {
  color: #1a1206;
  background: linear-gradient(180deg, #f4cd7c, #e0a63f);
  border-color: #f0c469;
  box-shadow: 0 0 10px rgba(232, 181, 99, .35);
}
.pc-level[data-level="normal"] { color: #9ecbff; border-color: #33506b; background: rgba(80, 140, 200, .12); }
.pc-level[data-level="easy"] { color: var(--text-faint); border-color: var(--line); }

.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.pc-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.pc-stats { display: flex; gap: 10px; flex: none; }
.stat { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-dim); }
.stat b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.stat.btns i { background: var(--gold); }
.stat.time i { background: var(--blue); border-radius: 2px; }
.stat.inc i { background: var(--green); }

/* 拼布板 */
.quilt {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1px;
  aspect-ratio: 1 / 1;
  width: 100%;
  position: relative;
}
.qcell {
  background: #12161f;
  border-radius: 1px;
  position: relative;
}
.qcell.filled {
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.28);
}
/* 补丁上的纽扣图标：收益为 n 就画 n 个小圆点 */
.qcell .pins {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8%;
  pointer-events: none;
}
.qcell .pin {
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: #262c40;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}
/* 落点预览：必须比任何补丁配色都显眼，所以用高亮绿 + 白内描边 */
.qcell.valid {
  background: rgba(120, 235, 180, .52);
  outline: 2px solid #86efbb;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}
.qcell.invalid {
  background: rgba(232, 90, 90, .4);
  outline: 2px solid #f08a8a;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
/* 左键固定后的落点：底色压满，一眼看出它已经不跟手了 */
.qcell.valid.locked {
  background: rgba(126, 240, 188, .85);
  outline: 3px solid #b6f7d6;
  outline-offset: -3px;
}
/* 已固定时，鼠标所在格给个淡描边，提示"点这里可以挪过去" */
.qcell.cursor { outline: 1px dashed rgba(232,181,99,.85); outline-offset: -1px; }

/* 联机时对手的实时预览：半透明、跟着他鼠标动 */
.qcell.ghost {
  background: rgba(232, 181, 99, .34);
  background: color-mix(in srgb, var(--ghost, #e8b563) 38%, transparent);
  outline: 1.5px dashed rgba(232, 181, 99, .9);
  outline-offset: -1.5px;
  animation: ghostPulse 1.5s ease-in-out infinite;
}
@keyframes ghostPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: .95; }
}

/* 「只剩跳过可做」时跳出来提醒的那个按钮 */
.btn.only-option:not(:disabled) {
  background: linear-gradient(180deg, #e8b563, #c08a4a);
  border-color: var(--gold);
  color: #241a06;
  font-weight: 700;
  transform: scale(1.12);
  transform-origin: right center;
  animation: advPulse 1.3s ease-in-out infinite;
}
@keyframes advPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(232, 181, 99, .20), 0 5px 14px rgba(232, 181, 99, .22); }
  50% { box-shadow: 0 0 0 7px rgba(232, 181, 99, .13), 0 8px 24px rgba(232, 181, 99, .45); }
}

.quilt.interactive .qcell { cursor: pointer; }

.pc-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
}
.bonus { color: var(--gold); opacity: 0; transition: opacity .2s; }
.bonus.on { opacity: 1; }

/* ---------------- 中间列 ---------------- */
.center {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 420px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ---------------- 补丁环 ---------------- */
.ring-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* v1.7.2 环放大到 376 后，左右内边距收窄到 8：给环上大补丁（5×5）留出
     横向伸进来的余地，不然 3 点 / 9 点方向的大块会探出 stage 压到邻列。 */
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
}
.ring-label {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  /* 标题 + 数量 + 环绕开关挤一行，窄屏放不下时让开关掉到第二行 */
  flex-wrap: wrap;
}
.rl-title { flex: none; }
.ring-rest { letter-spacing: 0; color: #5a6379; font-size: 10.5px; flex: 1; min-width: 0; text-align: right; }

/* 环绕方式开关（只有双人局才会现身）。放在标题行尾部，两段式，省地方。 */
.layout-switch {
  flex: none;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-soft);
}
.layout-switch[hidden] { display: none; }
.layout-switch button {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0;
  line-height: 1;
  padding: 4px 9px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.layout-switch button + button { border-left: 1px solid var(--line); }
.layout-switch button:hover { color: var(--text-dim); }
.layout-switch button.on { background: var(--gold-dim); color: #1a1405; font-weight: 600; }

/* 环本体。所有小补丁都以这里为坐标系（left/top:50% 就是圆心）。
   --ring-d   轨道直径。app.js 直接从 .ring-guide 的宽度反算半径，窄屏只改这个变量即可。
   --tb-cell  环心时间板的格子边长。9 列 × 6 行 = 正好 54 格，一格不剩不空。
   舞台高度要比轨道再多留 40px：12 点钟和 6 点钟那两块补丁是「骑」在圆周上的，
   只给 2R 的话它们会顶出舞台去压标题和正面卡片。 */
.ring-stage {
  --ring-d: 376px;
  --tb-cell: 28px;
  /* 环上小补丁的格子边长 / 间隙。补丁图形本身不再写死像素，
     所以同一枚 chip 搬到框上（--rc-tile 换成 7px）能自动变大，不用重建。 */
  --rc-tile: 6px;
  --rc-gap: 1px;
  position: relative;
  width: 100%;
  height: calc(var(--ring-d) + 40px);
  flex: none;
}

/* 环的轨道线。直径必须罩得住环心那块棋盘的半对角线，
   否则圆会从时间板的角上切过去。 */
.ring-guide {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--ring-d); height: var(--ring-d);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed var(--line);
  background: radial-gradient(circle, rgba(232,181,99,.055), transparent 70%);
}

/* 环心的棋盘底衬：托住时间板，让它读得出是「一块板」而不是浮在圆里 */
.ring-core {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px;
  border-radius: 10px;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 8px 22px rgba(0, 0, 0, .38);
}

.ring-far { position: absolute; inset: 0; }

/* ---------------- 「绕拼布板」布局 ----------------
   #frameStage 由 JS 精确贴到 .players 的矩形上（绝对定位于 .board-wrap），
   补丁沿这个圆角矩形路径排布，全部正放、等大。
   --fp  路径离舞台边缘多远   --fcr  圆角半径
   两个值由 app.js 里同一份 FRAME 常量写进来，别在这儿另写死一份。 */
.board-wrap { position: relative; }

.frame-stage {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  /* --rc-tile / --fp / --fcr 都由 app.js 写进来，这里只留兜底值 */
  --rc-tile: 8px;
  --rc-gap: 1px;
}
.frame-stage[hidden] { display: none; }

.frame-guide {
  position: absolute;
  inset: var(--fp, 26px);
  border: 1px dashed var(--line);
  border-radius: var(--fcr, 30px);
}

/* 换成环绕方式时把 .players 让出一条空带，补丁就落在这条带子里。
   v1.5 把这条带子（＝轨道）整个放宽了，好让补丁摆得更开、也画得更大：
     · .players 从 904px 放到 1000px（正好 = 94 + 400 + 12 + 400 + 94）；
     · 中间那列同步从 420px 收到 344px —— 绕拼布板时圆环不在了，
       中间只剩时间板和事件纪要，本来也吃不下 420px，把地方让给轨道正好。
   v1.7.2 再放宽一档：.players 1120px = 106 + 448 + 12 + 448 + 106，
     拼布板从 ~400px 涨到 ~448px，框上补丁格子也从 10px 涨到 11px。
   内边距只是个兜底值：真正的带宽由 app.js 的 frameBand() 按实际宽度算好写进内联样式
   （它必须 ≥ 路径内缩 + 补丁半身位 + 金色描边，否则描边会压到拼布板上）。 */
.board-wrap.layout-frame { grid-template-columns: minmax(0, 1fr) minmax(300px, 344px); }
.board-wrap.layout-frame .center { width: auto; }

.board-wrap.layout-frame .players {
  width: min(100%, 1120px);
  justify-self: center;
  align-self: center;
  height: fit-content;
  align-content: start;
  padding: 106px;
  overflow: visible;
}

/* 环切到框时：虚线圆收起来，时间板单独当一块小面板（不再有环心那回事） */
.ring-panel.layout-frame .ring-guide { display: none; }
.ring-panel.layout-frame .ring-stage {
  height: auto;
  display: flex;
  justify-content: center;
}
.ring-panel.layout-frame .ring-core {
  position: static;
  transform: none;
}

.ring-chip {
  position: absolute;
  left: 50%; top: 50%;
  transform-origin: 50% 50%;
  transition: transform .42s cubic-bezier(.34, .8, .3, 1), opacity .22s ease;
  pointer-events: none;   /* 纯图形，点击交给正面的大卡片 */
}
.rc-grid { display: grid; }
/* 格子的边长由 JS 写成 repeat(cols, var(--rc-tile)) 的轨道决定，
   这里只画外观，不再重复定义尺寸。 */
.rc-grid i {
  display: block;
  border-radius: 1px;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .35);
}
.rc-grid i.off { background: transparent; box-shadow: none; }

/* ---------------- v1.7：轨道数值签 ----------------
   「这块几个纽扣 / 走几格时间 / 每轮赚多少」直接写在补丁脚边，
   不用悬停或点开大卡片才知道 —— 1.0 起的老坑。配色与规则页图例
   一致：金 = 纽扣消耗、蓝 = 时间格数、绿 = 每轮增益。
   字号固定不随轨道远近缩放；签不拦点击（点了算点补丁）；与 chip
   同生命周期（placeChips 摆位、买走时一起淡出）。 */
.rc-tag {
  position: absolute;
  left: 50%; top: 50%;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 9px;
  background: rgba(16, 19, 26, .92);   /* --bg 压深，盖住轨道虚线 */
  border: 1px solid var(--line);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  z-index: 7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  transition: transform .42s cubic-bezier(.34, .8, .3, 1), opacity .22s ease;
}
.rc-tag .c { color: var(--gold); }
.rc-tag .t { color: var(--blue); }
.rc-tag .i { color: var(--green); }
/* 窄舞台变体：三行竖排。轨道上相邻补丁间距 ~27px，横排签 48px+ 必互压，
   竖排 ~22px 宽刚好塞进间距里（左右两列则贴到补丁内侧的空当）。 */
.rc-tag.stack {
  flex-direction: column;
  gap: 1px;
  padding: 3px 4px;
  font-size: 9px;
  border-radius: 7px;
}

/* ---------------- 可选补丁的标注 ----------------
   中立指示物前方那 3 块，在环上／框上也要一眼认出来，还能直接点。
   买得起 → 金色实描边 + 呼吸光晕 + 可点；买不起 → 细虚线，只是告诉你「轮到它们了」。 */
.ring-chip.option .rc-grid {
  outline: 1px dashed var(--gold-dim);
  outline-offset: 3px;
  border-radius: 3px;
}
.ring-chip.selectable {
  pointer-events: auto;
  cursor: pointer;
}
.ring-chip.selectable .rc-grid {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
  animation: chipBreath 1.6s ease-in-out infinite;
}
.ring-chip.picked .rc-grid {
  outline-color: #fff;
  box-shadow: 0 0 0 3px rgba(232, 181, 99, .45);
}
/* v1.6.5：框上被选中的那枚补丁，额外**放大 + 金色描边**。
   手机上框上格子只有 7px，一枚 3×3 补丁才 21px 见方 —— 点「旋转」后形状确实变了，
   但这个变化在 21px 里实在看不出来，用户会以为「按了没反应」。
   把格子边长临时提到 1.35 倍 + 加粗描边，转一下就能看清朝向变没变。
   （用 --rc-tile 而不是 transform：chip 自己的 transform 已经被
   translate(...) scale(...) 占用了，再叠一层会把位置带偏。） */
.board-wrap.layout-frame .ring-chip.picked {
  z-index: 6;
  --rc-tile: 9.5px;                  /* 7px × 1.35 */
}
.board-wrap.layout-frame .ring-chip.picked .rc-grid {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(232, 181, 99, .3), 0 0 14px rgba(232, 181, 99, .6);
  border-radius: 3px;
}
@keyframes chipBreath {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(232, 181, 99, 0)); }
  50% { filter: drop-shadow(0 0 5px rgba(232, 181, 99, .9)); }
}

/* 中立棋子（v1.5）：以前是个写着「中立」的小药丸，现在真的做成一枚棋子 ——
   斜上方打光的金属圆片，脚下再垫一圈椭圆阴影，看着是「立」在轨道上。
   位置由 app.js 算好，圆环时停在环内侧、圆角矩形时压在上边那条轨道上。 */
.ring-neutral {
  position: absolute;
  left: 50%; top: 50%;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff4d6 0%, #e8b563 42%, #a06f26 100%);
  box-shadow:
    0 0 0 2px rgba(22, 16, 6, .8),
    0 0 0 3.5px rgba(232, 181, 99, .34),
    0 3px 9px rgba(0, 0, 0, .6);
  transform-origin: 50% 50%;
  transition: transform .42s cubic-bezier(.34, .8, .3, 1);
  pointer-events: none;
  z-index: 3;
}
.ring-neutral::after {
  content: '';
  position: absolute;
  left: 50%; top: 100%;
  width: 22px; height: 5px;
  margin-left: -11px;
  margin-top: -2px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(232, 181, 99, .5), rgba(232, 181, 99, 0) 72%);
}

/* 时间板上的混沌格（魔改版专属）。底色走紫，跟绿色纽扣格、棕色皮革格
   在灰度上也区分得开 —— 色弱玩家同样认得出。 */
.tb-cell.chaos {
  background: linear-gradient(155deg, #3d2b58, #2a2340);
  box-shadow: inset 0 0 0 1px rgba(201, 139, 224, .34);
}
.tb-cell.chaos::after {
  content: '';
  width: 48%; height: 48%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d6ff, #8f6fd0 72%);
}
.tb-cell.chaos .num { color: #e2ccf7; opacity: .8; }

/* 正面三块：可点的大卡片。
   高度必须锁死 —— 形状有大有小、还有一句「差 N 纽扣」，
   放任它自己撑高会把整列顶出滚动条，把日志挤掉一截。 */
.ring-front { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ring-front .patch-card { padding: 8px; gap: 6px; }
.ring-front .patch-shape {
  position: relative;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring-front .patch-grid { min-height: 0; }
.ring-front .patch-grid .pc-cell { width: 10px; height: 10px; }
/* 「差 N 纽扣」盖在形状上，而不是另起一行把卡片顶高 */
.ring-front .patch-shape .patch-warn {
  position: absolute;
  left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  background: rgba(24, 16, 16, .84);
  border-radius: 4px;
  padding: 1px 0;
  font-size: 10px;
  pointer-events: none;
}

.patch-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .1s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.patch-card:hover:not(.disabled) { border-color: var(--gold-dim); transform: translateY(-1px); }
.patch-card.selected { border-color: var(--gold); background: #241f14; }
.patch-card.disabled { opacity: .4; cursor: not-allowed; }
.patch-card.empty { border-style: dashed; opacity: .3; cursor: default; }

/* 中立指示物正前方那一块，左边加一道金色标记条 */
.patch-card.next-up { border-left: 3px solid var(--gold-dim); }

.patch-warn {
  font-size: 10.5px;
  color: var(--red);
  text-align: center;
  padding-top: 2px;
}

.patch-grid {
  display: grid;
  gap: 2px;
  justify-content: center;
  align-content: center;
  min-height: 62px;
}
.patch-grid .pc-cell { width: 12px; height: 12px; border-radius: 2px; background: var(--pc, #5b6b8f); }
.patch-grid .pc-cell.off { background: transparent; }

.patch-meta { display: flex; justify-content: space-between; font-size: 11.5px; }
.patch-meta .cost { color: var(--gold); font-weight: 600; }
.patch-meta .t { color: var(--blue); }
.patch-meta .inc { color: var(--green); }
.patch-id {
  position: absolute; top: 6px; right: 8px;
  font-size: 10px; color: var(--text-faint);
  font-family: ui-monospace, monospace;
}

/* 时间板：住在环心里。格子用固定尺寸而不是 1fr，
   这样 .ring-core 能按内容自适应大小，环的半径才有确定依据。 */
.timeboard {
  display: grid;
  grid-template-columns: repeat(9, var(--tb-cell));
  grid-auto-rows: var(--tb-cell);
  gap: 2px;
}
.tb-cell {
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  /* 得比面板亮一点，否则深色格子和背景糊在一起，
     整块时间板只剩几个彩色格，看着像散落的花纹 */
  background: #2a3245;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.tb-cell.income { background: #24503a; }
.tb-cell.income::after {
  content: '';
  width: 52%; height: 52%;
  border-radius: 50%;
  background: var(--green);
}
.tb-cell.leather { background: #4a3826; }
.tb-cell.leather::after {
  content: '';
  width: 56%; height: 56%;
  border-radius: 2px;
  background: #c8964f;
}
.tb-cell.leather.claimed { background: #333a4a; }
.tb-cell.leather.claimed::after { background: #6b6252; }
.tb-cell.end { background: #5a2626; }
.tb-cell .tok {
  position: absolute;
  /* 具体位置与大小由脚本按人数算好后写成内联样式（见 app.js placeToken） */
  width: 42%; height: 42%;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .55);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}
.tb-cell .tok.top { z-index: 3; box-shadow: 0 0 0 1.5px var(--gold); }
.tb-cell .num { position: absolute; bottom: 0; right: 2px; font-size: 7.5px; opacity: .62; color: #cfd7e6; }
.tb-cell .neutral { position: absolute; top: 1px; left: 2px; font-size: 8px; color: var(--gold); }

/* 日志 */
.log-wrap {
  flex: 1;
  /* 下限别定太高：窗口一矮，中间列会被撑破，日志直接被裁掉。
     正常窗口下 flex:1 会把它撑得远大于这个值，所以调低不影响观感。
     v1.7.2 环放大吃掉了 ~17px 旧余量，下限从 104 收到 86 找补。 */
  min-height: 86px;
  position: relative;
  display: flex;
}
.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 11px 10px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.75;
  scrollbar-width: thin;
  scrollbar-color: #3b4560 transparent;
}
/* 让滚动条显眼一点，不然不知道能往上翻 */
.log::-webkit-scrollbar { width: 9px; }
.log::-webkit-scrollbar-track { background: transparent; }
.log::-webkit-scrollbar-thumb {
  background: #39435c;
  border-radius: 6px;
  border: 2px solid var(--panel);
}
.log::-webkit-scrollbar-thumb:hover { background: #4b5878; }
.log div { border-bottom: 1px solid rgba(255,255,255,.035); padding: 2px 0; }
.log div:last-child { border-bottom: none; }
/* 开局那一刻日志还是空的，给一句占位，免得看着像坏了 */
.log:empty::before { content: '事件纪要会一条条记在这里…'; color: var(--text-faint); }
.log .hl { color: var(--gold); }
.log .g { color: var(--green); }
/* 魔改版的混沌事件：日志里那一小段紫字，跟平常的纽扣/皮革事件区分开 */
.log .chaos-word { color: #d9bdf0; }
.log .b { color: var(--blue); }

/* 手动往上翻看历史时，新条目不再硬抢滚动位置，只用这个小按钮提示 */
.log-jump {
  position: absolute;
  right: 14px;
  bottom: 12px;
  background: var(--gold);
  color: #2a1e08;
  border: none;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
}
.log-jump:hover { background: #f0c072; }
.log-jump[hidden] { display: none; }

/* ---------------- 操作条 ---------------- */
.actionbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-soft);
}
.sel-info { font-size: 13px; color: var(--text-dim); }
.sel-info b { color: var(--gold); }
.sel-info .warn { color: var(--red); }
.act-right { display: flex; gap: 8px; }

/* ---------------- 弹层 ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 15, .78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.overlay.show { display: flex; }
.overlay-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px 20px;
  width: 400px;
  max-width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.overlay-card.wide { width: 560px; }
.overlay-card h2 { margin: 0 0 16px; font-size: 20px; color: var(--gold); font-weight: 600; }

.ov-body { font-size: 13px; line-height: 1.9; color: var(--text-dim); }
.ov-body .row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.ov-body .row:last-child { border-bottom: none; }
.ov-body .row .v { color: var(--text); font-variant-numeric: tabular-nums; }
.ov-body .row.total { font-size: 15px; padding-top: 9px; border-top: 1px solid var(--line); }
.ov-body .row.total .v { color: var(--gold); font-weight: 700; }
.ov-body .win { color: var(--green); font-weight: 600; }
.ov-body .lose { color: var(--red); }

/* ---------------- 锦标赛（v1.7.1 云端版） ---------------- */
.tw-join { display: flex; gap: 8px; margin-bottom: 8px; }
.tw-join input[type="text"] { flex: 1; min-width: 0; }
.tw-join #twName { flex: 1.6; }
.tw-join #twPhone { flex: 1; font-variant-numeric: tabular-nums; }
.tw-join .btn { flex: none; }
.tw-err { margin: 0 0 8px; color: var(--red); font-size: 12.5px; }
.tw-today { margin: 0 0 8px; color: var(--gold); font-size: 12.5px; }
@media (max-width: 660px) {
  .tw-join { flex-wrap: wrap; }
  .tw-join #twName { flex-basis: 100%; }
}
.tw-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--text-faint); line-height: 1.8; }
.tw-hint b { color: var(--gold); }
.tw-stats { margin: 0 0 10px; font-size: 13px; color: var(--text-dim); }
.tw-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.tw-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}
.tw-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.tw-row:hover { border-color: var(--gold-dim); }
.tw-rank {
  flex: none;
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.tw-row:first-child .tw-rank { color: var(--gold); }
.tw-name {
  flex: 1;
  min-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.tw-badge { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.tw-badge.win { color: var(--green); }
.tw-badge.lose { color: var(--red); }
.tw-badge.even { color: var(--text-dim); }
.tw-score { flex: none; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tw-date { flex: none; margin-left: auto; font-size: 11px; color: var(--text-faint); }
/* 管理员标注徽章：fake=已核伪（红），script=疑似脚本（橙）。mark 列只有云端管理端能写。 */
.tw-mark {
  flex: none;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.4;
  vertical-align: 1px;
}
.tw-mark.fake { color: var(--red); border: 1px solid var(--red); background: rgba(255, 77, 79, .08); }
.tw-mark.script { color: var(--gold); border: 1px solid var(--gold-dim); background: rgba(232, 181, 99, .08); }
.tw-row.tw-marked { opacity: .62; }
.tw-detail {
  flex-basis: 100%;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  cursor: default;
}
.tw-drow { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding-bottom: 6px; }
.tw-drow span { color: var(--text-faint); }
.tw-drow b { color: var(--text-dim); font-weight: 600; font-variant-numeric: tabular-nums; }
.tw-detail .score-table { margin-bottom: 8px; }
.tw-detail .score-table th:first-child,
.tw-detail .score-table td.rk { min-width: 34px; white-space: nowrap; }
.tw-actions-label { font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.tw-actions {
  max-height: 180px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-dim);
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.tw-muted { color: var(--text-faint); }
.tw-empty { margin: 4px 0 10px; font-size: 13px; color: var(--text-faint); text-align: center; }

/* ---------------- 等待开局 ---------------- */
.wait-code {
  margin: 0 0 8px;
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 34px;
  letter-spacing: .3em;
  color: var(--gold);
}
.wait-hint {
  margin: 0 0 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.7;
}
.wait-list { display: flex; flex-direction: column; gap: 6px; }
.wait-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
}
.wait-row.empty { opacity: .42; border-style: dashed; }
.wait-seat {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wait-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-tags { flex: none; font-size: 11px; color: var(--text-faint); }

/* ---------------- 结算表 ---------------- */
.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 10px;
}
.score-table th {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: .06em;
  text-align: right;
  padding: 0 6px 7px;
  border-bottom: 1px solid var(--line);
}
.score-table th:nth-child(1),
.score-table th:nth-child(2) { text-align: left; }
.score-table td {
  padding: 8px 6px;
  text-align: right;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.score-table td.rk,
.score-table td.nm { text-align: left; }
.score-table td.rk { width: 22px; font-size: 12px; color: var(--text-faint); }
.score-table td.nm { color: var(--text); }
.score-table td.tt { color: var(--gold); font-weight: 700; font-size: 15px; }
.score-table tr.first td { background: rgba(232, 181, 99, .07); }
.score-table tr.first td.rk { color: var(--gold); }
.score-note { margin: 0; font-size: 11.5px; color: var(--text-faint); line-height: 1.7; }

.tag-you {
  display: inline-block;
  margin-left: 6px;
  font-size: 10.5px;
  line-height: 15px;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 0 6px;
  vertical-align: 1px;
}
.ov-note { margin: 14px 0 0; font-size: 12px; color: var(--text-faint); }

/* ---------------- 更新日志 ---------------- */
.log-body .ver { margin-bottom: 20px; }
.log-body .ver:last-child { margin-bottom: 0; }
.log-body .ver h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
}
.log-body .ver-date { font-size: 11px; font-weight: 400; letter-spacing: .06em; color: var(--text-faint); }
.log-body .ver ul { margin: 0; padding-left: 18px; }
.log-body .ver li { margin-bottom: 6px; line-height: 1.75; }
.log-body .ver b { color: var(--text); }

.rules-body p { margin: 0 0 11px; }
.rules-body b { color: var(--text); }

/* ---------------- 规则与图例 ---------------- */
.rules-body h3 {
  margin: 20px 0 8px;
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: .04em;
}
.rules-body .rules-sec:first-child h3 { margin-top: 0; }
.rules-body p { margin: 0 0 9px; }
.rules-body .note { color: var(--text-faint); font-size: 12px; }
.rules-body kbd { margin: 0 1px; }
.rules-body .formula {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--text);
  font-size: 13px;
}

/* ---------------- 规则弹层 ----------------
   v1.7 起只讲经典规则（魔改版入口已下架），按变体显示的
   rv / data-scope / scope-tag 机制一并移除。 */

.legend { display: flex; flex-direction: column; gap: 7px; }
.legend-card {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.lg-title { font-size: 12px; color: var(--text-faint); margin-bottom: 5px; }
.lg-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; line-height: 1.5; }
.lg-row > span:last-child { color: var(--text-dim); }
.lg-row b { color: var(--text); }
.lg-swatch {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tb-normal { background: #2a3245; }
.tb-income { background: #24503a; }
.tb-income::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.tb-leather { background: #4a3826; }
.tb-leather::after { content: ''; width: 13px; height: 13px; border-radius: 2px; background: #c8964f; }
.tb-claimed { background: #333a4a; }
.tb-claimed::after { content: ''; width: 13px; height: 13px; border-radius: 2px; background: #6b6252; }
.tb-end { background: #5a2626; }
.tok-me, .tok-opp { background: #2a3245; }
.tok-me::after, .tok-opp::after {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.5);
}
.tok-me::after { background: var(--gold); box-shadow: 0 0 0 1.5px var(--gold); }
.tok-opp::after { background: #5c9dd6; }
.cell-valid {
  background: rgba(120, 235, 180, .52);
  outline: 2px solid #86efbb;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}
.cell-invalid {
  background: rgba(232, 90, 90, .4);
  outline: 2px solid #f08a8a;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.cell-pin { background: #4f7fb8; }
.cell-pin i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #262c40;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}
.cell-ghost {
  background: rgba(232, 181, 99, .34);
  outline: 1.5px dashed #e8b563;
  outline-offset: -1.5px;
}
.lg-num { flex: none; min-width: 62px; text-align: center; font-size: 12px; font-weight: 600; }
.lg-num.cost { color: var(--gold); }
.lg-num.t { color: var(--blue); }
.lg-num.inc { color: var(--green); }
/* 图例里那枚「轨道数值签」的迷你样本，长得跟轨道上真的一模一样（v1.7） */
.lg-swatch.tag-sample {
  display: flex;
  align-items: center;
  gap: 3px;
  width: auto;
  min-width: 0;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(16, 19, 26, .92);
  border: 1px solid var(--line);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
}
.lg-swatch.tag-sample i { font-style: normal; }
.lg-swatch.tag-sample .c { color: var(--gold); }
.lg-swatch.tag-sample .t { color: var(--blue); }
.lg-swatch.tag-sample .i { color: var(--green); }

.ov-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .center { width: 352px; }
  .patch-grid .pc-cell { width: 10px; height: 10px; }
  /* 窄一档：环和时间板一起等比缩，不用同步改 JS（半径是从轨道宽度反算的）
     v1.7.2 桌面档放大后（376/28），这里也跟着抬一档，仍然比桌面小一号 */
  .ring-stage { --ring-d: 312px; --tb-cell: 23px; }
  .ring-front .patch-shape { height: 50px; }
  /* 中间列收窄后，绕拼布板这条轨道还能多挤一点出来 */
  .board-wrap.layout-frame { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); }
}

/* 窗口矮的时候（笔记本 768p 之类）把环再缩一档，
   否则「环 + 时间板」那块棋盘会把下面的事件纪要整个挤掉。 */
@media (max-height: 760px) {
  .ring-stage { --ring-d: 312px; --tb-cell: 23px; }
  .ring-front .patch-shape { height: 50px; }
  /* 矮屏上主菜单可能顶到顶，把标题布片和分隔线都收一收 */
  .menu-card { padding: 18px 20px 14px; }
  .tile { width: 54px; height: 54px; font-size: 33px; border-radius: 9px; }
  .tile::before { inset: 5px; border-width: 1.5px; }
  .brand-deco { margin-top: 9px; }
  .menu-rule { margin: 8px 0; }
  .subtitle { margin-top: 8px; }
  /* 玩法卡片也压一压，否则 700 高的窗口还是会冒出滚动条 */
  .mode-card { padding: 10px 13px; margin-bottom: 7px; }
  .mode-card b { font-size: 14px; }
  .mode-card small { font-size: 11.5px; margin-top: 2px; }
  .sec-title { margin-bottom: 8px; }
  .inline-field { margin-bottom: 7px; }
}

/* 主菜单两栏在窄屏上摞回上下，竖排时把竖分隔线换成横的 */
@media (max-width: 780px) {
  .menu-grid { grid-template-columns: 1fr; gap: 0; }
  .menu-grid .menu-sec + .menu-sec {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--line);
    margin-top: 20px;
    padding-top: 18px;
  }
  .menu-top { flex-wrap: wrap; }
  .menu-top .field { flex: 1 1 100%; }
  .brand-deco { width: 100%; }
}

@media (max-width: 860px) {
  .board-wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    overflow-y: auto;
    padding: 10px;
  }
  .players { overflow: visible; }
  /* 窄屏一律单列，多少人都竖着排 */
  .board-wrap[data-n] .players { grid-template-columns: minmax(0, 1fr); }
  .players .player-card { max-width: 360px; }
  .center { width: 100%; order: 2; }
  .quilt { max-width: 300px; margin: 0 auto; }
  /* 窄屏本来就只有一列，圆角矩形那条框没地方摆，一律退回圆环 */
  .board-wrap.layout-frame { grid-template-columns: minmax(0, 1fr); }
  .board-wrap.layout-frame .center { width: 100%; }
}

/* ==================================================================
   手机适配（v1.6.2）
   ------------------------------------------------------------------
   上面那几个断点是按「小平板 / 窄笔记本」调的，最小只到 780px。
   真正的手机是 360~430px，落进来就拿不到任何针对性的规则，于是：

     1) 对局页横向溢出（body.scrollWidth 411 > 视口 390）——
        顶栏那一排按钮不肯换行，硬把 body 撑宽，整页能左右拖动；
     2) 主菜单 .menu-card 在 390 宽下高达 1129px，而视口只有 844 高，
        首屏被截断，得往下划好久才摸到「联机」；
     3) 玩家拼布板被顶出视口（.players top = -65），开局后看不见自己的板；
     4) 一堆按钮只有 19~37px 高，手指根本点不准（Apple 建议 >= 44px）。

   这一层只做「窄屏收紧 + 触控放大」，不改任何桌面端观感。
   ================================================================== */

/* ---- 1. 触控目标：手机上凡是能点的，最小 44px ---- */
@media (max-width: 480px) {
  .btn,
  .sfx-btn,
  .mode-card,
  .layout-switch button,
  .topbar-actions .btn,
  .menu-foot .btn,
  .ov-actions .btn {
    min-height: 44px;
  }
  /* tiny 按钮桌面端刻意做小，手机上单独抬起来 */
  .btn.tiny {
    min-height: 44px;
    padding: 0 12px;
    font-size: 12.5px;
  }
  .sfx-btn.compact {
    min-height: 44px;
    padding: 0 10px;
  }
  /* 表单控件同理：iOS 上小于 16px 的输入框还会触发自动放大 */
  input[type="text"],
  select {
    min-height: 44px;
    font-size: 16px;
  }
}

/* ---- 2. 主菜单：把纵向长度压下来，首屏能看到主要入口 ---- */
@media (max-width: 480px) {
  #menu {
    /* 刘海屏 / 手势条躲开 */
    padding: 12px 10px calc(16px + env(safe-area-inset-bottom));
    /* 手机上卡片通常比屏幕高，绝不能用居中 —— 内容一超高，居中会把顶部
       （标题布片、名字输入框）顶到负坐标、永远滚不回来。
       桌面端的 justify-content:center 在这里改回 flex-start。 */
    align-items: flex-start;
    justify-content: flex-start;
  }
  .menu-card {
    width: 100%;
    max-width: 100%;
    /* 关键：桌面端那句 margin:auto 在 flex 列容器里会吃掉垂直剩余空间，
       把卡片顶出上边界、又在底部留一大块空白。手机上必须只保留横向居中。 */
    margin: 0 auto;
    padding: 16px 14px 14px;
    border-radius: 13px;
  }

  /* 标题布片收一档，省下约 40px */
  .tile {
    width: 46px;
    height: 46px;
    font-size: 28px;
    border-radius: 8px;
  }
  .tile::before { inset: 4px; border-width: 1.5px; }
  .title { gap: 9px; }
  .subtitle { margin-top: 6px; font-size: 11px; letter-spacing: .16em; }
  .brand-deco { margin-top: 7px; }
  .deco-btn { width: 14px; height: 14px; }
  .deco-hourglass { width: 15px; height: 20px; }

  /* 粗分隔线矮一半，四条线全省下约 40px */
  .menu-rule { margin: 10px 0; }

  /* 名字 + 音效那一行：名字占满，音效按钮跟在下面 */
  .menu-top { gap: 8px; }
  .menu-top .field { flex: 1 1 100%; }

  /* 玩法卡片压薄，但保留 44px 触控高度 */
  .mode-card {
    padding: 10px 13px;
    margin-bottom: 8px;
  }
  .mode-card b { font-size: 14.5px; }
  .mode-card small { font-size: 11.5px; margin-top: 2px; }

  .sec-title { margin-bottom: 8px; font-size: 12.5px; }

  /* 单机 / 联机两栏在手机上必然上下排，把中间的竖线换成横线 */
  .menu-grid { grid-template-columns: 1fr; gap: 0; }
  .menu-grid .menu-sec + .menu-sec {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--line);
    margin-top: 16px;
    padding-top: 14px;
  }

  .inline-field { margin-bottom: 8px; gap: 8px; }
  .inline-field > span { font-size: 12.5px; }

  /* 底部两个按钮：手机上换成 grid 两列等宽。
     原来是 flex + .btn{flex:1 1 0}，实测在窄屏下 .menu-foot 会被撑到 317px
     高，按钮里的文字被挤成竖排单字（flex-basis:0 配合 stretch 的怪行为）。
     grid 没有这个坑，两列各 1fr，按钮高度由 min-height 决定。 */
  .menu-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    height: auto;
  }
  .menu-foot .btn {
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 0 8px;
  }
}

/* ---- 3. 对局页：窄屏重排，杜绝横向溢出 ---- */
@media (max-width: 480px) {
  html, body { overflow: hidden; }

  /* 顶栏是横向溢出的元凶 —— 允许换行，并让出刘海区 */
  .topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-top));
    row-gap: 6px;
  }
  .topbar-actions {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  .topbar-actions .btn { flex: 1 1 auto; }
  .room-tag, .mode-tag, .turn-tag { font-size: 11.5px; }
  /* 房间号那一长串在手机上会撑宽，允许它收缩 */
  .room-tag {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 主体一律单列、纵向滚动，玩家板排在上面（先看见自己的板）。
     注意：这里必须用 flex 而不是 grid —— grid 的 auto 行会把内容压缩进
     容器高度（实测 .board-wrap scrollH == clientH，补丁环被裁掉且滚不到），
     flex 才让子项溢出容器、激活 overflow-y:auto。 */
  .board-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    gap: 8px;
    /* v1.6.4：底部要多留出「操作条 + 手势条」那么高。
       操作条是文档流里的兄弟元素（flex:none，约 137px），不遮内容，
       但滚到底时环的最后一行补丁会紧贴操作条上沿 —— 留白不够就会觉得
       「要一直往下滑才够得着旋转/镜像」。给足留白，滚到底正好停在环下沿。 */
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .players,
  .center {
    flex: none;        /* 不许被压缩，超出就让 .board-wrap 滚 */
  }
  .players { overflow: visible; }
  .board-wrap[data-n] .players { grid-template-columns: minmax(0, 1fr); }
  .players .player-card { max-width: 100%; }

  /* 中央栏：补丁环 + 时间板整体缩到手机宽度内 */
  .center { width: 100%; order: 2; min-width: 0; }
  .ring-panel { padding: 8px; }
  /* v1.6.4：环直径要**跟着可用宽度走**，不能写死 236px。
     写死时环只用掉 341px 里的 236px（69%），周长 741px 要摊 30~33 块补丁，
     每块只剩 ~23px 弧长 → JS 的透视缩放把远处的缩到 3px，看着就是「一堆碎屑散在环上」。
     现在让它撑到容器宽度（- 2×面板内边距），弧长变长、补丁更大更匀。
     .ring-stage 高度由 calc(--ring-d + 40px) 自动跟随，正圆不会变形。 */
  .ring-panel { --mob-ring: min(341px, calc(100vw - 32px)); }
  .ring-stage {
    --ring-d: var(--mob-ring);
    /* 时间板 9 列要装进环心，跟着环一起缩。
       桌面基准是 336 / 25 = 13.44，但那是**桌面**的比例 —— 手机上环里
       还要塞得下骑在圆周上的补丁，时间板再小一档才不顶到环。
       取 15.2：390px 宽时格子约 22.4px，时间板 202px，环心刚好留出呼吸。 */
    --tb-cell: calc(var(--mob-ring) / 15.2);
    max-width: 100%;
  }
  .ring-front .patch-shape { height: 42px; }
  .ring-label { flex-wrap: wrap; gap: 6px; }
  .rl-title { font-size: 12.5px; }

  /* 圆角矩形环绕（绕拼布板）在手机上**也用**（v1.6.5）。
     双人局的 .players 已经是左右并排的横向矩形，正好是这套布局要的形状；
     空带由 JS 的 frameBand() 按窄屏收窄（20~30px，不再是桌面那 66~94px），
     框上格子也降到 7px（frameTile()）。这里只要保证舞台贴得住 .players 就行。 */
  .board-wrap.layout-frame { grid-template-columns: minmax(0, 1fr); }
  .board-wrap.layout-frame .center { width: 100%; }
  /* frame 布局下 .players 的桌面兜底是 padding:94px，手机上必须收掉 ——
     真实值由 JS 的 frameBand() 写成内联样式（手机上约 25px），
     这里补一条同权重的窄屏规则，万一 JS 还没跑到也不会炸。 */
  .board-wrap.layout-frame .players {
    padding: 24px;
    width: 100%;
  }
  /* 布局切换开关放出来（frame 布局在窄屏也站得住了） */

  /* 拼布板本身缩到屏幕内。
     v1.6.4：手机上环（341px 直径）才是主操作区，拼布板再收一档把高度让给它 ——
     原来 46vw 时两块板并排占 216px，环被挤到首屏外、操作条更是摸不到。
     现在 34vw：390px 宽时约 133px，9×9 每格 ~14px（点得中，且看得清针脚）。 */
  .quilt {
    max-width: min(100%, clamp(120px, 34vw, 200px));
    margin: 0 auto;
  }
  /* 两块板在手机上**左右并排**，比竖着叠省一半高度 */
  .board-wrap[data-n="2"] .players { grid-template-columns: 1fr 1fr; gap: 8px; }
  .board-wrap[data-n="2"] .players .player-card { max-width: 100%; }
  /* 玩家卡自己也收一收（桌面 9px 10px 内边距 + 名字行挺占地方） */
  .player-card { padding: 7px 8px 8px; }
  .player-card .pc-head { margin-bottom: 5px; }
  .player-card .pc-name { font-size: 12px; }
  .player-card .pc-foot { font-size: 11px; margin-top: 4px; }

  /* 底部操作区（旋转/镜像/跳过/确认）横向排布，按钮等宽好点。
     注意 align-items:center —— flex 默认 stretch 会把这些按钮纵向撑满，
     高度一旦跟着容器长，里面的文字就变竖排单字了。 */
  .actions,
  .ov-actions {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .actions .btn,
  .ov-actions .btn { flex: 1 1 auto; align-self: center; }

  /* 底部操作条：.act-right 里四个按钮不换行会顶破视口
     （实测 left=56 + 355 = 411 > 390），这里让它换行、并把信息行折到上一行。 */
  .actionbar {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }
  .act-left { flex: 1 1 100%; }
  .sel-info { font-size: 12.5px; }
  .act-right {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .act-right .btn {
    flex: 1 1 calc(50% - 4px);   /* 两列排布 */
    align-self: center;
    min-width: 0;
    padding: 0 8px;
    white-space: nowrap;
  }
  /* 键盘快捷键提示在手机上没意义（没键盘），去掉能省不少宽度 */
  .act-right kbd { display: none; }

  /* 环绕布局那圈 padding 是给桌面留轨道的，手机上把整块撑爆 */
  .board-wrap.layout-frame .players { padding: 16px; }
  .frame-stage { max-width: 100%; }
  .frame-guide { inset: var(--fp, 26px); }
}

/* ---- 4. 防溢出兜底：手机上任何元素都不许把 body 撑宽 ---- */
@media (max-width: 480px) {
  /* 桌面端有几个容器带了固定/最小宽度，手机上统一允许压到视口内，
     否则整页能左右拖动（实测 body.scrollWidth 411 > 390）。 */
  #menu, #game, .board-wrap, .players, .center, .ring-panel,
  .ring-stage, .ring-core, .timeboard, .actionbar, .topbar {
    max-width: 100%;
    min-width: 0;
  }
  /* ⚠️ 这里**不要**再包含 .quilt —— v1.6.2 把它写进来当兜底，
     结果它排在「拼布板缩一档」那条规则后面、特异性一样，直接把
     max-width: clamp(120px,34vw,200px) 冲成 100%，缩小的意图全失效
     （v1.6.4 排查了半天才逮到）。.quilt 有自己的专用规则，够用了。 */
  .menu-card, .mode-card, .player-card {
    max-width: 100%;
    min-width: 0;
  }
  /* 长串（房间码 / 局域网地址 / 日志行）一律可断行，别横向顶开 */
  code, .nh-row code, .log-line, #netUrl {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
