/**
 * BGA 风格主题（参考 bga1/style.css 重做）
 * ------------------------------------------------------------------
 * 木纹底 + 绿色牌桌 + 金色点缀，是 Board Game Arena 那套久经考验的桌游视觉。
 * 保留原有全部类名，并补齐卡片封面、头像、皇冠、准备勾、侧边栏分区等结构类。
 * 手机端一律降级为单列，触摸目标不小于 44px。
 * 新游戏的样式集中在文件末尾各自的分区里，改样式只动那一块。
 */

/**
 * 设计令牌（浅色）
 * ------------------------------------------------------------------
 * 主色调取主流平台通行的做法：中性灰阶打底（Slate 系）+ 单一低饱和品牌色
 * （青绿），强调「对比清晰」而不用高饱和撞色。所有界面元素只引用令牌，
 * 不再写死颜色 —— 换主题改这一块就够了。
 *
 * 分两类，别混用：
 *   · 界面令牌（--bg / --surface / --text / --brand …）：跟随深浅主题变化
 *   · 实物令牌（--felt / --wood / --board-* …）：牌桌、棋子、卡面这些"物理对象"
 *     在深浅色下都长一样，跟着主题变反而不像真桌子
 */
:root {
  color-scheme: light;

  /* ---- 界面底色与面 ---- */
  --bg: #f4f6f8;
  --bg-2: #e9edf2;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #eaeef3;
  --overlay: rgba(16, 22, 30, .55);
  --grid-line: rgba(20, 30, 45, .045);

  /* ---- 描边 ---- */
  --border: #dfe4ea;
  --border-strong: #c2cad4;

  /* ---- 文字 ---- */
  --text: #1b2330;
  --text-2: #566171;
  --text-3: #838d9b;
  --on-accent: #ffffff;   /* 品牌色/危险色底上的文字 */
  --on-dark: #eef2f7;     /* 深色实底（夜间阶段等）上的文字 */

  /* ---- 品牌与语义色 ---- */
  --brand: #2f6f5f;
  --brand-2: #24584b;
  --brand-3: #1c443a;
  --brand-soft: #e6f1ee;
  --win: #2f7d55;
  --win-soft: #e6f3ec;
  --warn: #9a6207;
  --warn-soft: #fbf1dd;
  --danger: #c0392b;
  --danger-2: #a32e22;
  --danger-3: #8d271c;
  --danger-soft: #fbeae8;
  --gold: #a8801f;
  --gold-2: #8a6a1f;
  --gold-3: #745816;
  --gold-soft: #f8efd9;

  /* ---- 三态：默认 / 选中 / 禁用（全局统一，不许各写各的）---- */
  --ctl-bg: var(--surface);
  --ctl-bg-hover: var(--surface-2);
  --ctl-bg-active: var(--surface-3);
  --ctl-border: var(--border-strong);
  --sel-bg: var(--brand);
  --sel-text: var(--on-accent);
  --sel-border: var(--brand-2);
  --sel-soft-bg: var(--brand-soft);
  --sel-soft-text: var(--brand-2);
  --dis-bg: var(--surface-3);
  --dis-text: var(--text-3);
  --dis-border: var(--border);

  /* ---- 实物色（不随主题变）---- */
  --felt: #2f6b4f;
  --felt-2: #23513c;
  --wood: #c9a06a;
  --wood-2: #a8814f;
  --board-blue: #cfd9e6;
  --board-blue-2: #bccbde;
  --board-cream: #f6efe1;
  --board-cream-2: #e6dcc6;
  --dish: #efe7d4;          /* 花砖工厂的瓷盘 */
  --dish-2: #ddd2b4;
  --quilt: #e9dcc0;         /* 拼布的被子布面 */
  --quilt-2: #d8c8a6;
  --tile-dark: #3d3d3d;     /* 花砖已铺满的墙面格 */

  /* ---- 兼容旧命名的语义别名（老类名还在用，指向新令牌）---- */
  --bga-bg: var(--bg);
  --bga-bg-dark: var(--bg-2);
  --bga-wood: var(--wood);
  --bga-wood-dark: var(--wood-2);
  --bga-header: var(--surface);
  --bga-green: var(--brand);
  --bga-green-dark: var(--brand-2);
  --bga-red: var(--danger);
  --bga-gold: var(--gold);
  --bga-text: var(--text);
  --bga-text-light: var(--text-2);
  --bga-border: var(--border);
  --bga-panel: var(--surface-2);

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.09);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.3);
  --tap: 44px;
  --pad: clamp(12px, 3.2vw, 24px);
  --font: 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/**
 * 深色主题
 * ------------------------------------------------------------------
 * 由 <html data-theme> 驱动：启动时 index.html 里的内联脚本先读 localStorage
 * 的 bg_theme（默认跟随系统），在首帧前把属性写上，所以不会有白闪。
 * 只覆盖「界面令牌」，实物令牌（牌桌/棋子/卡面）保持原样 ——
 * 真桌子不会因为环境光暗了就变成另一张桌子。
 */
html[data-theme='dark'] {
  color-scheme: dark;

  --bg: #0f1319;
  --bg-2: #151a21;
  --surface: #1a2029;
  --surface-2: #212832;
  --surface-3: #2a323d;
  --overlay: rgba(6, 9, 13, .68);
  --grid-line: rgba(255, 255, 255, .04);

  --border: #2c3440;
  --border-strong: #3d4753;

  --text: #e6eaef;
  --text-2: #a4adb9;
  --text-3: #727d8b;
  --on-accent: #0a1411;   /* 暗色下品牌色更亮，其上的文字要反过来变深 */
  --on-dark: #eef2f7;

  --brand: #5cb8a5;
  --brand-2: #3f8b7b;
  --brand-3: #2f6f62;
  --brand-soft: #17302b;
  --win: #5cc08a;
  --win-soft: #16301f;
  --warn: #d8a34a;
  --warn-soft: #33280f;
  --danger: #e2685e;
  --danger-2: #c04a41;
  --danger-3: #a03b33;
  --danger-soft: #331a18;
  --gold: #d4b062;
  --gold-2: #b8944a;
  --gold-3: #96762f;
  --gold-soft: #2e2717;

  --sel-bg: var(--brand);
  --sel-text: #0a1411;
  --sel-border: var(--brand-2);
  --sel-soft-bg: var(--brand-soft);
  --sel-soft-text: var(--brand);

  /* 深色下阴影要更"沉"，否则浮层像贴在背景上 */
  --shadow: 0 2px 6px rgba(0, 0, 0, .5);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, .55);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  /* 极淡的网格底纹：用 currentColor 的透明度做，深浅色下都只是"一点点纹理" */
  background-image:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/**
 * 控件三态：默认 / 选中 / 禁用
 * ------------------------------------------------------------------
 * 状态必须"看得出来"而不只是"变淡"：
 *   默认 —— 白底 + 实心描边 + 轻微投影
 *   悬停/按下 —— 底色沉一档（--ctl-bg-active），按下另有 1px 位移
 *   选中 —— 品牌色实心 + 反色文字 + 品牌色描边（.active / [aria-pressed=true]）
 *   禁用 —— 灰底 + 灰字 + 灰描边 + 无投影 + not-allowed（不接受 hover 反馈）
 */
button {
  cursor: pointer;
  border: 1px solid var(--ctl-border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  min-height: var(--tap);
  font-weight: 600;
  background: var(--ctl-bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  transition: background-color .12s ease, transform .1s ease, box-shadow .14s ease, border-color .12s ease;
}
button:hover:not(:disabled) { background: var(--ctl-bg-hover); box-shadow: var(--shadow); }
button:active:not(:disabled) { background: var(--ctl-bg-active); transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .14); }
button:disabled,
button[disabled] {
  background: var(--dis-bg);
  color: var(--dis-text);
  border-color: var(--dis-border);
  box-shadow: none;
  opacity: 1;              /* 不用 opacity：透明度会让文字对比度掉到不可读 */
  cursor: not-allowed;
}

/* 选中态：全局统一，任何可切换的控件（导航 / 筛选 / 卡牌选择）都用这两条 */
button.active,
button[aria-pressed='true'],
.active:not(button),
[aria-selected='true'] {
  background: var(--sel-bg);
  color: var(--sel-text);
  border-color: var(--sel-border);
}
/* 次级选中（不想抢主按钮视觉时用）：淡品牌底 + 品牌色文字 */
.active-soft, .is-selected-soft {
  background: var(--sel-soft-bg);
  color: var(--sel-soft-text);
  border-color: var(--sel-border);
}

.btn-primary {
  background: linear-gradient(to bottom, var(--brand), var(--brand-2));
  color: var(--on-accent);
  border-color: var(--brand-2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(to bottom, var(--brand-2), var(--brand-3)); box-shadow: 0 3px 8px rgba(0, 0, 0, .22); }
.btn-primary:disabled { background: var(--dis-bg); color: var(--dis-text); border-color: var(--dis-border); box-shadow: none; }
.btn-gold {
  background: linear-gradient(to bottom, var(--gold), var(--gold-2));
  color: var(--on-accent);
  border-color: var(--gold-3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .26);
}
.btn-danger { background: linear-gradient(to bottom, var(--danger), var(--danger-2)); border-color: var(--danger-3); color: var(--on-accent); }
.btn-danger:disabled { background: var(--dis-bg); color: var(--dis-text); border-color: var(--dis-border); box-shadow: none; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 13px; }

input[type="text"], input[type="number"], select {
  min-height: var(--tap);
  border: 1px solid var(--ctl-border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--ctl-bg);
  color: var(--text);
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05);
}
input:disabled, select:disabled { background: var(--dis-bg); color: var(--dis-text); border-color: var(--dis-border); }
input:focus-visible, button:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: var(--pad); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

.card {
  background: var(--bga-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.muted { color: var(--text-2); }
.dim { color: var(--text-3); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------- BGA 骨架：横栏 + 侧边栏 + 内容区（照 bga1 模板） ---------------- */
.bga-header {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(to bottom, var(--surface), var(--surface-2));
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  padding-top: env(safe-area-inset-top);
}
.bga-header-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 8px var(--pad);
  display: flex; align-items: center; gap: 18px;
}
.bga-logo { display: flex; align-items: center; gap: 8px; flex: none; cursor: pointer; }
.bga-logo-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(135deg, var(--bga-green), var(--bga-green-dark));
  display: grid; place-items: center; font-size: 19px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}
.bga-logo-text {
  font-size: 18px; font-weight: 700; color: var(--bga-green);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .08); white-space: nowrap;
}
.bga-nav { display: flex; gap: 4px; }
.bga-nav-item {
  padding: 0 14px; min-height: 36px;
  display: flex; align-items: center;
  border-radius: 6px; font-size: 13px; font-weight: 600;
  color: var(--text); border: 1px solid transparent; background: transparent;
}
.bga-nav-item:hover { background: rgba(0, 0, 0, .05); border-color: var(--border); }
.bga-nav-item.active { background: var(--bga-green); color: var(--on-accent); border-color: var(--bga-green-dark); }

.bga-user { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.bga-user-info { text-align: right; }
.bga-username { font-size: 13px; font-weight: 700; line-height: 1.2; }
.bga-elo { font-size: 11px; color: var(--bga-gold); }
.bga-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 17px;
  color: var(--on-accent); border: 2px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .35);
}

.bga-main { display: flex; align-items: stretch; min-height: calc(100vh - 58px); }
.bga-main.no-side .bga-sidebar { display: none; }
.bga-sidebar {
  width: 210px; flex: none;
  background: linear-gradient(to right, var(--bga-panel), var(--bga-header));
  border-right: 1px solid var(--border);
  padding: 14px 10px;
}
.sidebar-section { margin-bottom: 18px; }
.sidebar-title {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 0 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; min-height: 36px;
  border-radius: 6px; font-size: 13px; cursor: pointer; margin-bottom: 2px;
  border: 1px solid transparent; background: transparent; color: inherit; font-weight: 500;
  text-align: left; width: 100%;
}
.sidebar-item:hover { background: rgba(0, 0, 0, .05); }
.sidebar-item.active { background: var(--bga-green); color: var(--on-accent); }
.sidebar-icon { width: 20px; flex: none; display: grid; place-items: center; }
.sidebar-badge {
  margin-left: auto; background: var(--bga-red); color: var(--on-accent);
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
}
.bga-content { flex: 1 1 auto; min-width: 0; padding: var(--pad); }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--border);
}
.page-title { font-size: clamp(18px, 4.4vw, 22px); font-weight: 700; margin: 0; color: var(--bga-green-dark); }
.page-subtitle { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }

/* 手机：侧边栏降级成可横滑的标签条，不占竖向空间 */
@media (max-width: 880px) {
  .bga-main { flex-direction: column; }
  .bga-sidebar {
    width: auto; border-right: none; border-bottom: 1px solid var(--border);
    padding: 8px; display: flex; gap: 10px; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-section { margin-bottom: 0; display: flex; gap: 6px; flex: none; }
  .sidebar-title { display: none; }
  .sidebar-item { white-space: nowrap; width: auto; }
  .bga-logo-text { display: none; }
}

@media (max-width: 560px) {
  .bga-header-inner { gap: 6px; padding: 6px 10px; }
  .bga-logo-icon { width: 32px; height: 32px; }
  .bga-nav { gap: 2px; flex: 1; }
  .bga-nav-item { padding: 0 8px; min-height: 40px; white-space: nowrap; }
  .bga-user { gap: 4px; }
  .bga-user-info { display: none; }
  .bga-avatar { width: 32px; height: 32px; }
}

/* ---------------- 顶栏（保留，兼容旧类名） ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(to bottom, var(--surface), var(--surface-2));
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px var(--pad);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo { font-weight: 700; font-size: 17px; color: var(--bga-green); letter-spacing: .3px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--bga-green), var(--bga-green-dark));
  color: var(--on-accent);
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}

/* 用户区：头像 + 昵称，点击可改 */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
  min-height: 38px;
  box-shadow: var(--shadow);
}
.user-chip:hover { border-color: var(--bga-green); }
.user-chip .u-name { font-size: 13px; font-weight: 600; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; line-height: 1; flex: none;
  border: 2px solid rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .35), 0 1px 2px rgba(0, 0, 0, .18);
  font-weight: 700;
  position: relative;
}
.avatar.lg { width: 42px; height: 42px; font-size: 21px; }
.avatar.sm { width: 24px; height: 24px; font-size: 12px; border-width: 1.5px; }
.avatar .crown { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 12px; }
.avatar .check {
  position: absolute; right: -3px; bottom: -3px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bga-green); color: var(--on-accent);
  font-size: 10px; display: grid; place-items: center;
  border: 1.5px solid var(--surface);
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.on { background: var(--bga-green); }
.dot.off { background: var(--bga-red); }

/* ---------------- 资源清单接入层（assets.js） ----------------
   有授权素材时用 <img>，没有时走 art.js 手绘回退。
   这里只约定「图片怎么撑满它所在的槽位」，具体尺寸仍由槽位类控制。 */
.asset-img { display: block; max-width: 100%; object-fit: contain; }

/* 按钮 / 输入框里的小图标（ui/* 槽位，48×48 单色线稿）
   线稿是深色描边（#3d4753）画在透明底上，深色主题下原样放上去等于隐形，
   所以深色主题统一转成白色描边：brightness(0) 只压 RGB、不动 alpha，
   透明区仍是透明；invert(1) 再把黑线翻成白线。 */
.btn-icon { width: 16px; height: 16px; flex: none; }
.btn-icon-18 { width: 18px; height: 18px; flex: none; }
html[data-theme='dark'] .btn-icon,
html[data-theme='dark'] .btn-icon-18 { filter: brightness(0) invert(1); }
.cover-img { width: 100%; height: 100%; object-fit: cover; }
.cell .piece { width: 76%; height: 76%; }
.tile-img { width: 100%; height: 100%; object-fit: contain; }
.pile-img, .card-img, .back-img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.role-badge-img, .badge-icon, .avatar-face { width: 100%; height: 100%; object-fit: contain; }

/* ---------------- 原创矢量美术（art.js） ---------------- */
.game-cover {
  height: clamp(84px, 24vw, 104px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.game-cover.cover-art { padding: 0; }
.cover-art svg, .game-cover svg { display: block; width: 100%; height: 100%; }
.cell svg { display: block; width: 76%; height: 76%; }
.game-board-placeholder .icon.cover-art {
  width: clamp(96px, 30vw, 150px);
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 auto 8px;
  font-size: 0;
}
.game-board-placeholder .icon.cover-art svg { border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }

/* ---------------- 大厅 ---------------- */
.hero { margin: 2px 0 16px; }
.hero h1 { font-size: clamp(21px, 5.2vw, 30px); margin: 0 0 6px; font-weight: 700; color: var(--bga-green-dark); }
.hero p { margin: 0; color: var(--text-2); font-size: 14px; }

.game-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.game-card {
  text-align: left;
  padding: 0;
  min-height: auto;
  background: var(--bga-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.game-card:hover:not([data-selected="true"]) { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--bga-green); }
.game-card[data-selected="true"] {
  border-color: var(--bga-green);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px var(--bga-green) inset, var(--shadow-md);
}
.game-cover {
  height: clamp(84px, 24vw, 104px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.game-card .g-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.game-card .g-body { flex: 1; }
.game-card > .game-cover { width: 100%; padding: 0; border: 0; border-radius: 0; min-height: 104px; flex-shrink: 0; }
.game-card > .game-cover:hover { transform: none; }
.game-card .cover-img { transition: transform .25s ease; }
.game-card:hover .cover-img { transform: scale(1.035); }
@media (prefers-reduced-motion: reduce) { .game-card .cover-img { transition: none; } }
.game-card .g-name { font-weight: 700; font-size: 15px; }
.game-card .g-meta { font-size: 11px; color: var(--text-2); }
.game-card .g-desc {
  font-size: 12px; color: var(--text-3); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.game-card .g-flag {
  display: none; margin-top: 4px; font-size: 11px; font-weight: 700; align-self: flex-start;
  color: var(--on-accent); background: var(--bga-green); border-radius: 4px; padding: 1px 6px;
}
.game-card[data-selected="true"] .g-flag { display: inline-block; }
/* Selected article uses a soft brand surface, so supporting copy stays dark. */
.game-card[data-selected="true"] .g-meta,
.game-card[data-selected="true"] .g-desc { color: var(--text-2); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 600; }

.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; background: var(--bga-panel);
  box-shadow: var(--shadow);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.room-row:hover { border-color: var(--bga-green); box-shadow: var(--shadow-md); }
.room-row .rid {
  font-weight: 700; letter-spacing: 1px; font-size: 13px;
  background: var(--bga-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 8px; color: var(--text-2);
}
.room-row .r-name { font-weight: 600; font-size: 14px; }
.room-row .r-sub { font-size: 12px; color: var(--text-2); }

.tag {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  font-weight: 600;
}
.tag.live { background: var(--win-soft); color: var(--brand-2); border-color: transparent; }
.tag.wait { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ---------------- 房间页 ---------------- */
.room-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 940px) {
  .room-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .room-side { position: sticky; top: 72px; }
}

.section-title {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  margin: 0 0 8px; display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: .5px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/*
 * 深色毛毡桌面上的文字：分区标题 / 说明文字必须抬成浅色。
 * --text-2(#5b6672) 压在毛毡(#2f6b4f)上只有 1.9:1，实测基本看不见 ——
 * 心智蠕虫、炸弹猫、UNO 这三张深色桌都吃这条。data-table 由 app.js 的
 * applyTableBg() 打上（light / dark），不要在渲染器里各自硬编码颜色。
 */
.game-area[data-table='dark'] .section-title {
  color: #e4efe8;
  border-bottom-color: rgba(255, 255, 255, .22);
}
.game-area[data-table='dark'] .dim,
.game-area[data-table='dark'] .mb-skill,
.game-area[data-table='dark'] .mb-pile-label,
.game-area[data-table='dark'] .kt-hint {
  color: #bed2c7;
}

/* 游戏区：木纹底 + 牌桌 */
/**
 * 牌桌：木纹桌面 + 中央绿绒布
 * ------------------------------------------------------------------
 * 真桌子由「木框 + 绒布台面」两层构成，这里用纯 CSS 分层画出来（零图片请求）：
 * 底层木纹用重复渐变模拟年轮，上层绒布用双向细网纹模拟织物 + 内阴影压边。
 * 拿到授权素材后由 assets.js 的 bg/wood、bg/table-felt 接管（applyBackground 会覆写 background-image）。
 */
.game-area {
  background-color: var(--wood);
  background-image:
    repeating-linear-gradient(90deg, rgba(120, 82, 40, .16) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 23px),
    linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(0, 0, 0, .12));
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .12);
  padding: 14px;
}
/* 台面：织物纹理 + 四周压暗的暗角。
   刻意只用半透明叠加、不铺满不透明深色：牌桌上的文字/面板底色各异，
   铺一层实色深绿会把浅色面板上的深色文字压成不可读。 */
.game-area::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(rgba(255, 255, 255, .04) 0 1px, transparent 1px 5px),
    radial-gradient(130% 100% at 50% 45%, transparent 45%, rgba(0, 0, 0, .16) 100%);
  pointer-events: none;
  z-index: 0;
}
.game-area { position: relative; }
.game-area > * { position: relative; z-index: 1; }
.game-area .card { background: var(--surface); border-color: var(--border); }
.game-area .empty { color: var(--text-2); }

.players { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.player {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; background: var(--surface);
  font-size: 14px;
  transition: border-color .14s ease, background .14s ease;
}
.player.is-turn { border-color: var(--bga-green); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--bga-green) inset; }
.player.is-dead { opacity: .48; }
.player.is-dead .p-name { text-decoration: line-through; }
.player .p-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.player .badge {
  margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); flex: none; font-weight: 600;
}
.player .badge.host { background: var(--gold-soft); color: var(--gold-2); }

/* ---------------- 棋盘 ---------------- */
.board {
  width: 100%;
  max-width: min(92vw, 520px);
  margin: 0 auto;
  aspect-ratio: 1;
  display: grid;
  gap: 3px;
  padding: 8px;
  background: linear-gradient(160deg, var(--board-cream), var(--board-cream-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .1);
  touch-action: manipulation;
}
.cell {
  border: none;
  background: var(--surface);
  border-radius: 6px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: clamp(18px, 5.5vw, 34px);
  font-weight: 700;
  line-height: 1;
  position: relative;
  transition: background-color .12s ease;
}
.cell:not(:disabled):hover { background: var(--surface-3); }
.cell.x { color: var(--bga-green-dark); }
.cell.o { color: var(--bga-red); }
.cell.win { background: var(--win-soft); }
.cell.last::after {
  content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--bga-green);
}

/* 棋子为 art.js 的原创 SVG（stone/disc/markX/markO），配色由 .cell 底衬决定 */
.cell.gomoku { padding: 0; background: var(--wood); }
.cell.gomoku:hover { background: var(--wood-2); }
.cell.connect4 { background: var(--board-blue); padding: 0; }
.cell.connect4:hover { background: var(--board-blue-2); }

/* ---------------- UNO ----------------
   下面 .u-* 是牌面本身的颜色（红黄绿蓝黑），属于实物色：
   环境变暗，牌不会跟着变灰，所以这里保留固定值，不跟随主题。 */
.uno-table {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 12px; flex-wrap: wrap;
  background: linear-gradient(160deg, var(--felt), var(--felt-2));
  border-radius: var(--radius);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .3), var(--shadow);
}
.uno-top {
  width: clamp(64px, 17vw, 84px);
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  padding: 0;
  border: none;
  background: transparent;
  filter: drop-shadow(0 4px 9px rgba(0, 0, 0, .35));
}
.uno-top svg { display: block; width: 100%; height: 100%; }
.uno-color-chip { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: var(--shadow); }

.hand {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 2px 12px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.card-uno {
  flex: none;
  width: clamp(50px, 13vw, 72px);
  aspect-ratio: 2 / 3;
  border-radius: 9px;
  border: none;
  background: transparent;
  padding: 0;
  scroll-snap-align: center;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .24));
  transition: transform .12s ease;
}
/* 卡面既可能是 art.js 的内联 SVG，也可能是清单里的 <img>，两条路都要撑满卡框 */
.card-uno svg, .card-uno img,
.uno-top svg, .uno-top img { display: block; width: 100%; height: 100%; }
.card-uno img, .uno-top img { border-radius: 9px; }
.card-uno:not(:disabled):not(.dim):hover { transform: translateY(-5px); }
.card-uno.playable { outline: 3px solid var(--bga-gold); outline-offset: 1px; border-radius: 11px; }
.card-uno:disabled, .card-uno.dim { opacity: .72; filter: grayscale(.4) brightness(.94); }
.u-red { background: linear-gradient(160deg, #e05a4f, #a02e2a); }
.u-yellow { background: linear-gradient(160deg, #eec44a, #b08820); }
.u-green { background: linear-gradient(160deg, #4a9d63, #2c6b40); }
.u-blue { background: linear-gradient(160deg, #4a83c0, #2a5a91); }
.u-black { background: linear-gradient(160deg, #4a4a48, #22221f); }

/* 对手手牌背面缩略 */
.uno-back { width: 22px; height: 33px; flex: none; display: block; }
.uno-back svg { display: block; width: 100%; height: 100%; border-radius: 3px; }

.color-picker { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.swatch { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: var(--shadow); }

/* ---------------- 数字炸弹 ---------------- */
.bomb-art { width: 56px; height: 56px; margin: 0 auto 2px; }
.bomb-art svg { display: block; width: 100%; height: 100%; }
.bomb-range {
  text-align: center; padding: 18px 10px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .06);
}
.bomb-num { font-size: clamp(26px, 9vw, 44px); font-weight: 800; letter-spacing: 1px; color: var(--bga-red); }
.bomb-bar {
  height: 10px; border-radius: 999px; background: var(--surface-2);
  margin: 12px auto 0; max-width: 320px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}
.bomb-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--bga-gold), var(--bga-red)); border-radius: 999px; transition: width .2s ease; }
.guess-row { display: flex; gap: 8px; align-items: center; }
.guess-row input { max-width: 110px; }

/* ---------------- 狼人杀 ---------------- */
.phase-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: var(--radius);
  font-weight: 700; font-size: 15px;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .12);
}
.phase-night { background: linear-gradient(180deg, #2c3e50, #1b2836); color: var(--on-dark); }
.phase-day { background: linear-gradient(180deg, #fbeedc, #f3e2c6); color: var(--warn); }
.phase-vote { background: linear-gradient(180deg, #e6efe7, #d8e6da); color: var(--bga-green-dark); }
.phase-hunter { background: linear-gradient(180deg, #fbe9e7, #f2d7d3); color: var(--danger); }

.role-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; background: linear-gradient(180deg, var(--surface), var(--surface-2));
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
}
.role-badge { width: 44px; height: 44px; flex: none; display: block; }
.role-badge svg { display: block; width: 100%; height: 100%; }

.log {
  max-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; -webkit-overflow-scrolling: touch;
}
.log-item { padding: 5px 9px; border-radius: var(--radius-sm); background: var(--surface-2); }
.log-item.win { background: var(--win-soft); color: var(--bga-green-dark); font-weight: 600; }
.log-item.warn { background: var(--warn-soft); color: var(--warn); }

.chat-log {
  max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; -webkit-overflow-scrolling: touch;
}
.chat-log .msg {
  word-break: break-word; line-height: 1.5;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px 8px;
}
.chat-log .who { font-weight: 700; margin-right: 4px; color: var(--bga-green-dark); }

/* ---------------- 花砖物语 ---------------- */
.az-factories { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
/* 工厂是实体桌游里的圆形窑盘：圆形底盘 + 4 块砖 + 编号徽标 */
.az-factory {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-strong);
  background: radial-gradient(circle at 50% 38%, var(--surface), var(--dish) 62%, var(--dish-2));
  box-shadow: var(--shadow), inset 0 -3px 6px rgba(0, 0, 0, .08);
  padding: 8px;
}
.az-factory > .dim {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--tile-dark); color: var(--gold); border: 1px solid var(--border-strong);
}
.az-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.az-center { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; min-height: 34px; }
/* 砖块尺寸必须是确定值。
   曾经写成 width:100% —— 在工厂的 grid 里没问题，但中央区是 flex 行，
   flex 子项的 100% 会解析成整行宽度（900px），配合 aspect-ratio:1 直接
   变成一块 900×900 的巨型砖块。这就是"拖动砖块后尺寸异常放大"的真凶。 */
.az-tile {
  flex: 0 0 auto;
  width: clamp(32px, 8.5vw, 42px);
  height: clamp(32px, 8.5vw, 42px);
  padding: 0;
  border-radius: 5px; border: 1px solid rgba(0, 0, 0, .18);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .28), inset 0 2px 2px rgba(255, 255, 255, .35);
}
/* 工厂内部是 2×2 的 grid 格子，让砖块填满各自格子即可 */
.az-tiles .az-tile { width: 100%; height: auto; aspect-ratio: 1; }
/* 关键：花砖里的 SVG 只有 viewBox、没有宽高属性，不定死尺寸会按浏览器默认
   300×150 渲染 —— 这就是"拖动砖块后尺寸异常放大"（幽灵卡里的克隆砖爆大）的根因 */
.az-tile svg, .az-tile .tile-img { display: block; width: 100%; height: 100%; }
.az-tile.is-picked { outline: 3px solid var(--bga-green); outline-offset: 1px; }
.az-tile:disabled { opacity: .55; }
.az-first {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700;
  background: var(--tile-dark); color: var(--gold);
}
.az-panel { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.az-lines { display: flex; flex-direction: column; gap: 4px; }
.az-line {
  display: flex; gap: 3px; align-items: center; min-height: auto; padding: 2px 4px;
  border: 1px solid transparent; background: transparent; border-radius: 6px;
  box-shadow: none;
}
.az-line:not(:disabled):hover { background: var(--surface-2); border-color: var(--border); }
.az-slot {
  width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--surface); display: inline-block; position: relative; overflow: hidden;
}
.az-slot.on { box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .3), inset 0 2px 2px rgba(255, 255, 255, .3); }
.az-slot svg { display: block; width: 100%; height: 100%; }
.az-first-mini {
  display: block; width: 100%; height: 100%; line-height: 18px; text-align: center;
  color: var(--bga-gold); font-size: 11px; font-weight: 800;
}
.az-floor { display: flex; gap: 3px; flex-wrap: wrap; }
.az-wall {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px;
  width: clamp(96px, 26vw, 130px);
}
.az-wall.sm { width: clamp(70px, 18vw, 92px); }
.az-cell {
  aspect-ratio: 1; border-radius: 4px; overflow: hidden;
  border: 1px dashed var(--border-strong); background: var(--surface);
}
.az-cell.on { border-style: solid; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .3), inset 0 2px 2px rgba(255, 255, 255, .3); }
.az-cell svg { display: block; width: 100%; height: 100%; }
.az-others { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); }
.az-other {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px;
  background: var(--bga-panel);
}

/* ---------------- 拼布艺术 ---------------- */
/* 织物纹理：纯 CSS 斜纹叠加在内联色上，零 JS 开销也有布料质感 */
.pw-px.on, .pw-cell.on, .az-slot.on {
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .16) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 5px);
}
.pw-coin { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--text-2); }
.pw-coin .pw-coin-img, .pw-coin > svg { display: block; width: 18px; height: 18px; }
.pw-track { display: flex; flex-direction: column; gap: 6px; }
.pw-track-row { display: flex; align-items: center; gap: 8px; }
.pw-who { width: 4.5em; font-size: 13px; color: var(--text-2); flex: none; font-weight: 600; }
.pw-line { flex: 1 1 auto; position: relative; display: flex; align-items: center; min-height: 14px; }
/* 时间轨棋子：浮在进度条上方，位置跟着 --p 走 */
.pw-pawn {
  position: absolute; left: var(--p, 0%); top: -3px; transform: translateX(-50%);
  width: 20px; height: 20px; pointer-events: none;
}
.pw-pawn svg, .pw-pawn .pw-pawn-img { display: block; width: 100%; height: 100%; }
.pw-bar {
  flex: 1 1 auto; height: 10px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden; position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}
.pw-bar::after {
  content: ''; position: absolute; inset: 0 auto 0 0;
  width: var(--p, 0%); background: linear-gradient(90deg, var(--bga-green), var(--bga-gold));
  border-radius: 999px; transition: width .2s ease;
}
.pw-shop { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-patch {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px; min-height: auto; border: 1px solid var(--border); background: var(--surface);
}
.pw-patch.is-picked { border-color: var(--bga-green); box-shadow: 0 0 0 2px var(--bga-green) inset; }
.pw-shape { display: grid; gap: 2px; }
.pw-px { width: 12px; height: 12px; border-radius: 2px; background: var(--surface-2); }
.pw-px.on { box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .35); }
.pw-board {
  display: grid; gap: 2px; width: 100%;
  max-width: min(92vw, 420px); aspect-ratio: 1;
  background: linear-gradient(160deg, var(--quilt), var(--quilt-2));
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 4px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .14);
}
.pw-board.sm { max-width: 200px; }
.pw-cell {
  border-radius: 3px; border: 1px solid rgba(0, 0, 0, .07);
  background: var(--surface); min-height: 0; padding: 0;
}
.pw-cell.on { box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .28), inset 0 1px 1px rgba(255, 255, 255, .4); }
.pw-cell.prev { outline: 2px solid var(--bga-green); outline-offset: -2px; }

/* ---------------- 炸弹猫 ---------------- */
.kt-table { display: flex; gap: 20px; justify-content: center; padding: 10px 0; }
.kt-deck { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.kt-pile {
  width: clamp(56px, 15vw, 74px); aspect-ratio: 2 / 3;
  border-radius: 10px; padding: 0; border: none; display: block;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .28);
  overflow: hidden;
}
.kt-pile svg { display: block; width: 100%; height: 100%; }
.kt-pile.ghost { opacity: .55; filter: grayscale(.65); }
.kt-banner { min-height: 0; }

/* 炸弹猫手牌（art.js 原创卡面） */
.card-kt {
  flex: none;
  width: clamp(50px, 13vw, 72px);
  aspect-ratio: 2 / 3;
  border: none; background: transparent; padding: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .3));
  transition: transform .12s ease;
}
.card-kt svg { display: block; width: 100%; height: 100%; }
.card-kt:not(:disabled):hover { transform: translateY(-5px); }
.card-kt.playable { outline: 3px solid var(--bga-gold); outline-offset: 1px; border-radius: 11px; }
.card-kt:disabled { opacity: .35; }

/* ---------------- 心智蠕虫 ---------------- */
.mb-banner { min-height: 0; }
.mb-lifebar { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.mb-life { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.mb-who { font-weight: 700; min-width: 4em; }
.mb-side { min-height: 44px; }
.mb-piles { display: flex; gap: 14px; align-items: flex-end; }
.mb-pile-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mb-pile { position: relative; width: 46px; height: 69px; }
.mb-pile .mb-back-img, .mb-pile svg { display: block; width: 100%; height: 100%; border-radius: 6px; }
.mb-pile-count {
  position: absolute; right: -4px; bottom: -4px; min-width: 20px; text-align: center;
  padding: 1px 4px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--bga-header); color: var(--text); border: 1px solid var(--border-strong);
}
.mb-bugs { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.mb-bugs .mb-bug-img, .mb-bugs svg { display: block; width: 16px; height: 16px; }
.mb-block-tag {
  grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--bga-green);
  background: var(--brand-soft); border-radius: 4px; padding: 1px 5px; justify-self: start;
}
.mb-creatures { display: flex; gap: 6px; flex-wrap: wrap; }
.mb-creature {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 6px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 9px; background: var(--surface); font-size: 13px; min-width: 136px;
  box-shadow: var(--shadow);
}
.mb-portrait { width: 30px; height: 30px; flex: none; }
.mb-portrait svg { display: block; width: 100%; height: 100%; }
/* 刚上场（召唤失调）：用「虚线边框 + 轻微变淡」表达，不靠 .48 的重透明度 ——
   毛毡底上那一档会把名字和攻/血一起糊掉，玩家反而看不清场上有什么。 */
.mb-creature.sick { opacity: .8; border-style: dashed; }
.mb-creature.is-atk { border-color: var(--danger); background: var(--danger-soft); }
.mb-creature.is-blk { border-color: var(--bga-green); background: var(--brand-soft); }
.mb-atk { font-weight: 800; color: var(--bga-red); }

.mb-cname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mb-skill { grid-column: 1 / -1; font-size: 11px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.mb-skill-icon { width: 13px; height: 13px; display: block; flex: none; }
.mb-skill-icon svg { display: block; width: 100%; height: 100%; }

/* 心智蠕虫手牌（art.js 原创生物牌） */
.card-mb {
  flex: none;
  width: clamp(64px, 16vw, 84px);
  aspect-ratio: 100 / 132;
  border: none; background: transparent; padding: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .25));
  transition: transform .12s ease;
}
.card-mb svg { display: block; width: 100%; height: 100%; }
.card-mb:not(:disabled):hover { transform: translateY(-5px); }
.card-mb:disabled { opacity: .35; }

/* ---------------- 房间页（照 bga1 模板：左牌桌 + 右面板） ---------------- */
.bga-content.room-content { padding: 0; }
.room-container { display: flex; flex-direction: column; min-height: calc(100vh - 58px); }

.room-header {
  background: linear-gradient(to bottom, var(--bga-header), var(--bga-panel));
  border-bottom: 2px solid var(--border);
  padding: 10px var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.room-title-section { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.room-table-id {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--text-2);
  background: var(--bga-bg); padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border);
}
.room-game-name { font-size: 17px; font-weight: 700; color: var(--text); }
.room-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bga-green); animation: pulse 2s infinite; }
.status-dot.wait { background: var(--bga-gold); }
.status-dot.end { background: var(--text-3); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.room-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px var(--pad); background: var(--bga-panel);
  border-bottom: 1px solid var(--border);
}

.room-main { flex: 1 1 auto; display: flex; min-height: 0; }
.room-main .game-area {
  flex: 1 1 auto; min-width: 0; padding: 16px;
  display: flex; align-items: center; justify-content: center; overflow: auto;
}
.game-stage { width: 100%; max-width: 900px; display: flex; flex-direction: column; gap: 12px; }
.game-board {
  width: 100%; max-width: 520px; aspect-ratio: 4 / 3; margin: 0 auto;
  background: linear-gradient(160deg, var(--bga-green), var(--bga-green-dark));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3),
    inset 0 2px 4px rgba(255, 255, 255, .2),
    inset 0 -2px 4px rgba(0, 0, 0, .2);
}
.game-board-placeholder { text-align: center; color: rgba(255, 255, 255, .88); padding: 20px; }
.game-board-placeholder .icon { font-size: clamp(40px, 12vw, 68px); opacity: .65; margin-bottom: 8px; }
.game-board-placeholder h3 { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.game-board-placeholder p { font-size: 13px; opacity: .75; margin: 0; }

.side-panel {
  width: 290px; flex: none; min-height: 0;
  background: var(--bga-panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.panel-section { border-bottom: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.panel-section.grow { flex: 1 1 auto; }
.panel-header {
  padding: 10px 14px;
  background: linear-gradient(to bottom, var(--bga-header), var(--bga-panel));
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .5px;
}
.players-list { padding: 8px; }
.player-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; margin-bottom: 4px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.player-item:hover { background: rgba(0, 0, 0, .03); }
.player-item.host { background: rgba(212, 168, 75, .1); border-color: rgba(212, 168, 75, .3); }
.player-item.ready { background: rgba(74, 124, 89, .08); }
.player-item.is-turn { background: var(--brand-soft); border-color: var(--bga-green); }
.player-item.is-dead { opacity: .5; }
.player-item.is-dead .player-name { text-decoration: line-through; }
.player-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center; font-size: 16px; color: var(--on-accent); font-weight: 700;
  border: 2px solid rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .35), 0 1px 2px rgba(0, 0, 0, .18);
}
.player-avatar .crown { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 13px; }
.player-avatar .ready-check {
  position: absolute; bottom: -2px; right: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bga-green); color: var(--on-accent); font-size: 10px;
  display: grid; place-items: center; border: 1.5px solid var(--surface);
}
.player-details { flex: 1 1 auto; min-width: 0; }
.player-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-status { font-size: 11px; color: var(--text-2); }
.player-actions { display: flex; gap: 4px; flex: none; }
.player-action-btn {
  width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; font-size: 12px;
}
.player-action-btn:hover { background: var(--bga-bg); border-color: var(--bga-green); }

.chat-area { display: flex; flex-direction: column; min-height: 0; }
.chat-messages { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px; font-size: 12px; }
.chat-message { margin-bottom: 6px; line-height: 1.5; word-break: break-word; background: var(--surface-2); border-radius: 6px; padding: 4px 8px; }
.chat-message .sender { font-weight: 700; color: var(--bga-green-dark); margin-right: 4px; }
.chat-input-area { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.chat-input { flex: 1 1 auto; min-height: 36px; }
.chat-send-btn { flex: none; min-height: 36px; }

@media (max-width: 880px) {
  .room-main { flex-direction: column; }
  .side-panel { width: auto; border-left: none; border-top: 1px solid var(--border); }
  .chat-messages { max-height: 170px; }
}

/* ---------------- 弹层 ---------------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(30, 26, 20, .55);
  display: grid; place-items: center;
  padding: var(--pad);
  z-index: 60;
  backdrop-filter: blur(2px);
}
.result, .modal {
  background: var(--bga-panel); border-radius: 14px; padding: 22px;
  width: min(100%, 380px); text-align: center;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease-out;
}
.modal { text-align: left; }
.modal h3 { margin: 0 0 12px; font-size: 17px; color: var(--bga-green-dark); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result h2 { margin: 0 0 6px; font-size: 21px; }
.result { position: relative; max-height: calc(100dvh - 24px); overflow-y: auto; }
/* 终局遮罩的关闭按钮：右上角常驻，点了就收起遮罩但不离开房间 */
.result-close {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; padding: 0;
  min-height: 30px; border-radius: 50%; line-height: 1; font-size: 14px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  box-shadow: none;
}
.result-close:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button {
  min-height: 40px; padding: 0; font-size: 19px;
  border: 1px solid var(--border); background: var(--surface);
}
.emoji-grid button[aria-pressed="true"] { border-color: var(--bga-green); box-shadow: 0 0 0 2px var(--bga-green) inset; }
.color-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.color-grid button { min-height: 32px; padding: 0; border-radius: 6px; border: 2px solid transparent; }
.color-grid button[aria-pressed="true"] { border-color: var(--text); }

.toast {
  position: fixed;
  left: calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2);
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  box-sizing: border-box;
  width: max-content;
  max-width: min(440px, calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  padding: 11px 16px 11px 44px;
  border: 1px solid var(--club-line, var(--border));
  border-radius: 14px;
  background: var(--club-surface, var(--surface));
  color: var(--club-ink, var(--text));
  box-shadow: 0 3px 0 var(--club-raised, var(--surface-2)), 0 8px 24px rgb(15 33 24 / .18);
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  text-align: start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  z-index: 100;
  pointer-events: none;
}

.toast::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--club-selection, var(--surface-2));
}

.toast::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 20px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--club-green, var(--bga-green));
}

body:has(.room-immersive) > .toast {
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 1300;
}

@media (max-width: 880px) {
  body:has(#app:not(.community-keyboard) > .site-bottom-nav) > .toast {
    bottom: calc(66px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-enter .16s ease-out; }
}

@keyframes toast-enter {
  from { opacity: 0; transform: translate(-50%, 5px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.empty { text-align: center; color: var(--text-3); padding: 22px 0; font-size: 14px; }

/* ---------------- 游戏库（搜索 + 分类筛选） ---------------- */
.search-bar { display: flex; align-items: center; gap: 8px; }
.search-bar input { flex: 1 1 auto; }
.filter-search { width: 100%; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  min-height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
}
.filter-btn:hover { border-color: var(--bga-green); }
.filter-btn.active { background: var(--bga-green); color: var(--on-accent); border-color: var(--bga-green-dark); }

/* ---------------- 创建桌子弹层（照 bga1 的 create modal） ---------------- */
.game-select-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  max-height: 240px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.game-select-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px; min-height: auto; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
.game-select-item:hover { border-color: var(--bga-green); }
.game-select-item.selected { border-color: var(--bga-green); box-shadow: 0 0 0 2px var(--bga-green) inset; background: var(--brand-soft); }
.game-select-item .icon { font-size: 26px; }
.game-select-item .name { font-size: 12px; font-weight: 700; }
.game-select-item .meta { font-size: 11px; color: var(--text-3); }
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.form-input { width: 100%; }
.form-select { width: 100%; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.checkbox-row input { width: auto; min-height: 0; }

/* ---------------- 社区聊天（真实大厅聊天） ---------------- */
.community-layout {
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
}
.community-card {
  background: var(--bga-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
  margin-bottom: 14px;
}
.community-card-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }
.community-notice { font-size: 12px; color: var(--text-3); line-height: 1.6; }
.chat-area-large {
  background: var(--bga-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-height: 440px; overflow: hidden;
}
.chat-header-large {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--bga-header), var(--bga-panel));
}
.chat-channel-icon {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, var(--bga-green), var(--bga-green-dark)); color: var(--on-accent);
}
.chat-messages-large {
  flex: 1 1 auto; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch;
  min-height: 280px;
}
.message-row { display: flex; gap: 10px; align-items: flex-start; }
.message-row.self { flex-direction: row-reverse; }
.message-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--on-accent);
}
.message-body { max-width: 80%; }
.message-sender { font-size: 12px; font-weight: 700; color: var(--bga-green-dark); margin-bottom: 2px; }
.message-row.self .message-sender { text-align: right; }
.message-text {
  background: var(--surface-2); border-radius: 10px; padding: 8px 12px;
  font-size: 14px; line-height: 1.5; word-break: break-word; color: var(--text);
}
.message-row.self .message-text { background: var(--bga-green); color: var(--on-accent); }
.system-message { text-align: center; font-size: 13px; color: var(--text-3); padding: 18px 0; font-style: italic; }
.chat-input-bar { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat-input-large { flex: 1 1 auto; }
.chat-send-round {
  width: 42px; height: 42px; min-height: 0; flex: none; padding: 0;
  border-radius: 50%; font-size: 18px;
  background: linear-gradient(to bottom, var(--bga-green), var(--bga-green-dark));
  color: var(--on-accent); border-color: var(--bga-green-dark);
}
.online-count { font-weight: 700; font-size: 13px; color: var(--bga-green-dark); padding: 0 2px 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.online-player { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.online-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--on-accent);
}
.status-dot-online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bga-panel); }
.status-dot-online.online { background: var(--bga-green); }
.online-info { min-width: 0; }
.online-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-status { font-size: 11px; color: var(--text-3); }

/* ---------------- 我的资料页 ---------------- */
.profile-header-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--bga-panel), var(--bga-header));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px;
}
.profile-avatar-large {
  width: 76px; height: 76px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 36px; color: var(--on-accent); font-weight: 700;
  border: 3px solid var(--surface); box-shadow: var(--shadow-md);
}
.profile-user-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-username { font-size: 22px; font-weight: 800; color: var(--text); }
.profile-rank-badge {
  align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--gold-2);
  background: var(--gold-soft); border-radius: 999px; padding: 3px 10px;
}
.profile-joined { font-size: 12px; color: var(--text-3); }
.stats-card {
  display: flex; align-items: center; background: var(--bga-panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.stat-item { flex: 1 1 0; text-align: center; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-value.win { color: var(--bga-green-dark); }
.stat-value.streak { color: var(--bga-gold); }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.stat-divider { width: 1px; align-self: stretch; background: var(--border); margin: 0 8px; }
.profile-card {
  background: var(--bga-panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.profile-card-title { font-size: 14px; font-weight: 700; color: var(--text-2); margin-bottom: 12px; }
.badges-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-item {
  width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center;
  font-size: 26px; background: var(--surface-2); border: 1px solid var(--border);
}
.badge-item.unlocked { background: var(--brand-soft); border-color: var(--bga-green); box-shadow: 0 0 0 1px var(--bga-green) inset; }
.badge-item.locked { filter: grayscale(1); opacity: .55; }

/* ---------------- 成就页 ---------------- */
.ach-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ach-item {
  background: var(--bga-panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.ach-item.locked { opacity: .72; }
.ach-icon { font-size: 40px; }
.ach-title { font-size: 14px; font-weight: 700; color: var(--text); }
.ach-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ---------------- 设置页 ---------------- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-title { font-size: 14px; font-weight: 600; color: var(--text); }
.setting-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.switch {
  appearance: none; -webkit-appearance: none; width: 46px; height: 26px; min-height: 0;
  border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer;
  border: none; padding: 0; transition: background .15s ease; flex: none;
}
.switch::after {
  content: ''; position: absolute; top: 50%; left: 3px; width: var(--switch-thumb,20px); height: var(--switch-thumb,20px); transform:translateY(-50%);
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: left .15s ease;
}
.switch:checked { background: #2162ee; }
.switch:checked::after { left:calc(100% - 3px - var(--switch-thumb,20px)); }

@media (max-width: 880px) {
  .community-layout { grid-template-columns: minmax(0, 1fr); }
  .profile-header-card { gap: 14px; padding: 18px; }
  .stats-card { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ==================================================================
   拖拽层（web/js/drag.js）
   ------------------------------------------------------------------
   三种状态在视觉上必须一眼分得清，否则玩家不敢松手：
     候选（能放）金色圈 · 悬停合法 绿框 · 悬停非法 红框
   非法松手 → 幽灵卡飞回原位 + 来源卡抖动 + toast 说明原因
   ================================================================== */

.draggable {
  touch-action: none;          /* 触屏拖拽时不被浏览器滚动手势抢走 */
  -webkit-user-drag: none;
  user-select: none;
  cursor: grab;
}
.draggable:active { cursor: grabbing; }
body.dnd-active { user-select: none; }
body.dnd-active * { cursor: grabbing !important; }

.dnd-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;        /* 幽灵卡不参与命中检测，否则自己挡住放置区 */
  transform: translate3d(-9999px, -9999px, 0);
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .38));
  will-change: transform;
}
.dnd-ghost > * { width: 100%; height: 100%; }
/* 幽灵卡里的 SVG 克隆体同样要锁尺寸（无宽高的 <svg> 默认 300×150，会把幽灵卡撑爆） */
.dnd-ghost svg { display: block; width: 100%; height: 100%; }

/* 被拖走的来源卡：留在原位半透明占位，玩家仍看得见"手牌少了一张" */
.dnd-dragging { opacity: .32; filter: saturate(.55); }

.drop-zone {
  position: relative;
  transition: box-shadow .16s ease, transform .16s ease, background-color .16s ease;
}
.drop-zone.drop-candidate {
  box-shadow: 0 0 0 2px var(--bga-gold), 0 0 14px rgba(212, 168, 75, .55);
}
.drop-zone.drop-over { transform: translateY(-2px) scale(1.02); }
.drop-zone.drop-ok {
  box-shadow: 0 0 0 3px var(--bga-green), 0 0 24px rgba(74, 124, 89, .65);
  background-color: rgba(74, 124, 89, .12);
}
.drop-zone.drop-bad {
  box-shadow: 0 0 0 3px var(--danger), 0 0 24px rgba(192, 57, 43, .55);
  background-color: rgba(192, 57, 43, .12);
}
.drop-flash { animation: dnd-flash-kf .34s ease; }

/* 不可出/不可用的卡牌：用 class 而不是 disabled —— disabled 的按钮收不到 pointerdown，
   那样就没法把它拖出去看到"非法放置自动回退"的反馈了 */
/* 不可出的牌：只做轻微降饱和 + 压暗，不要用 .35 那种重透明度 ——
   牌面是在深色毛毡上看的小图，透明度一压，攻/血数字和技能名先糊掉（实测 .35 完全读不出）。
   禁用态靠"变淡"表达，而不是靠"看不见"表达。 */
.card-unplayable { opacity: .72; filter: grayscale(.4) brightness(.94); }
@keyframes dnd-flash-kf {
  0% { box-shadow: 0 0 0 4px var(--bga-green), 0 0 28px rgba(74, 124, 89, .8); }
  100% { box-shadow: 0 0 0 0 rgba(74, 124, 89, 0); }
}
.dnd-invalid { animation: dnd-shake-kf .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes dnd-shake-kf {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* ==================================================================
   连接状态 / 掉线提示
   ================================================================== */

.bga-header > .net-bar {
  background: #fff2d5;
  color: #694309;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 3px 12px;
  pointer-events: none;
}
.net-bar:empty { display: none; }

.afk-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  padding: 10px 12px;
  background: var(--warn-soft);
  border: 1px solid rgba(180, 83, 9, .3);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  color: var(--warn);
  font-size: 13px;
  line-height: 1.5;
}
.afk-line { display: flex; align-items: center; gap: 8px; }
.afk-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  animation: afk-pulse-kf 1.2s ease-in-out infinite;
}
@keyframes afk-pulse-kf {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
.afk-banner b { font-weight: 700; }

/* ---- 操作窗口倒计时条 ----
   细长一条，不抢牌桌的位置；最后 5 秒转成警告色，轮到自己时再加左边条强调。 */
.turn-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 22px;
  margin: 6px 0;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.turn-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--brand-soft);
  transition: width .25s linear;
}
.turn-bar-text { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.turn-bar.is-mine { border-color: var(--brand); }
.turn-bar.is-mine .turn-bar-fill { background: var(--brand-soft); }
.turn-bar.is-urgent .turn-bar-fill { background: var(--danger-soft); }
.turn-bar.is-urgent { color: var(--danger); border-color: var(--danger); }

/* ---- 分段选择器（设置页：主题 / 超时时长）---- */
.seg {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.seg-btn {
  min-height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
.seg-btn:hover:not(.active) { background: var(--surface-3); color: var(--text); }
/* 选中态：品牌色实心 + 反色文字，和全局 button.active 保持一致 */
.seg-btn.active { background: var(--sel-bg); color: var(--sel-text); }

.room-table-id { cursor: pointer; }
.room-table-id:hover { color: var(--bga-green-dark); text-decoration: underline dotted; }
.player-item.is-offline .player-avatar { filter: grayscale(1) brightness(.92); }
.player-item.is-offline .player-name { color: var(--text-3); }

/* ==================================================================
   表情 / 表情包
   ================================================================== */

.chat-input-area { position: relative; }
.emoji-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  font-size: 17px;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.emoji-toggle:hover { border-color: var(--bga-gold); background: var(--surface-2); }
.emoji-toggle.active { background: var(--bga-green); border-color: var(--bga-green-dark); }

.emoji-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);   /* 相对 .chat-input-area（position: relative 的锚点）向上弹出 */
  z-index: 60;
  width: min(300px, 88vw);
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--bga-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
}
.emoji-panel.show { display: block; }
.emoji-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.emoji-tab {
  flex: 1;
  padding: 6px 4px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.emoji-tab.active {
  background: var(--bga-green);
  border-color: var(--bga-green-dark);
  color: var(--on-accent);
  font-weight: 600;
}
.emoji-grid-sm { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-btn {
  padding: 3px;
  font-size: 19px;
  line-height: 1.25;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease;
}
.emoji-btn:hover { background: var(--surface-2); transform: scale(1.18); }
.sticker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sticker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.sticker-btn:hover { transform: translateY(-2px); border-color: var(--bga-gold); }
.sticker-btn span { font-size: 11px; color: var(--text-2); }

.sticker-img { display: block; width: 64px; height: 64px; }
.sticker-img svg { display: block; width: 100%; height: 100%; }
.sticker-btn .sticker-img { width: 56px; height: 56px; }

.chat-message { display: flex; align-items: flex-start; gap: 6px; }
.chat-message .sender { flex: 0 0 auto; font-weight: 600; color: var(--bga-green-dark); }
.chat-message .chat-time { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--text-3); flex: 0 0 auto; }
.chat-message.is-sticker { align-items: center; }
.chat-message.is-sticker .sticker-img { width: 84px; height: 84px; }
.chat-message.is-system {
  justify-content: center;
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}
.chat-message.is-system .sender { color: var(--text-3); font-weight: 500; }

/* ============================================================ 麻将（web/js/games/mahjong.js）
   牌桌：四家手牌 + 中央牌墙/牌河 + 底部动作条 */
.mj-table { display: flex; flex-direction: column; gap: 10px; }

.mj-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 牌面
   SVG 只有 viewBox、没有宽高属性，不定死尺寸会按浏览器默认的 300×150 渲染；
   立体感靠下缘的 drop-shadow，牌面本身由 art.js 画好（象牙白牌身 + 竹青牌背），
   深色模式下也不用改颜色 —— 底色全走 CSS 变量。 */
.mj-tile {
  flex: 0 0 auto;
  width: clamp(26px, 7.4vw, 40px);
  height: auto;
  aspect-ratio: 60 / 84;
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  line-height: 0;
  position: relative;
  transition: transform .12s ease;
}
.mj-tile.sm { width: clamp(20px, 5.2vw, 28px); }
.mj-tile svg,
.mj-tile .mj-tile-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
}
/* 自己的手牌可点：抬起一点，牌河与副露里的 span 版牌面没有 hover */
/* 只有手牌是 button，牌河 / 副露 / 牌背都是 span —— 光标与抬起只给能点的那一份 */
button.mj-tile:not(:disabled) { cursor: pointer; }
button.mj-tile:not(:disabled):hover { transform: translateY(-3px); }
button.mj-tile:disabled { opacity: .45; filter: grayscale(.4); cursor: not-allowed; }
.mj-tile.is-back { cursor: default; }
/* 刚摸进来的那张描一圈品牌色，一眼看出"该打它" */
.mj-tile.is-drawn::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--brand);
  border-radius: 6px;
  pointer-events: none;
}
/* 牌河里最新打出的那张：描一圈警示色，响应窗口就是围着它转的 */
.mj-tile.is-last { outline: 2px solid var(--warn); outline-offset: 1px; }

/* ---------------------------------------------------------------- 其他三家 */
.mj-others { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.mj-seat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.mj-seat.is-turn {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
  background: var(--brand-soft);
}
.mj-seat-top { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mj-seat-name { font-weight: 600; color: var(--text); }
.mj-wind { font-weight: 800; color: var(--text-2); }
.mj-dealer {
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); font-weight: 700;
}
.mj-backs { display: flex; flex-wrap: wrap; gap: 2px; }
.mj-meld-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- 牌河 */
.mj-center { display: flex; flex-direction: column; gap: 6px; }
.mj-river {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}
.mj-river.is-turn { border-color: var(--brand); background: var(--brand-soft); }
.mj-river-name { flex: 0 0 76px; font-size: 12px; color: var(--text-2); }
.mj-river-tiles { display: flex; flex-wrap: wrap; gap: 2px; }

/* ---------------------------------------------------------------- 副露 */
.mj-melds { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 30px; }
.mj-meld {
  display: inline-flex; align-items: flex-end; gap: 2px;
  padding: 2px 5px 2px 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.mj-meld.is-concealed { border-style: dashed; }
.mj-meld-kind { align-self: center; padding-left: 2px; font-size: 11px; color: var(--text-3); }

/* 牌桌底色是米色 / 木纹这类"实物色"（不随主题变），--text-3 压上去只有 2.9:1，
   远低于正文标准。提示语、副露类型、空态说明这些真要看的小字一律抬到 --text-2（5.5:1）。
   只限 .mj-table 内，不动全局 --text-3 —— 别处（面板、卡片）的第三级文字是有意做轻的。 */
.mj-table .mj-hint,
.mj-table .mj-meld-kind,
.mj-table .dim { color: var(--text-2); }

/* ---------------------------------------------------------------- 我的手牌 / 动作条 */
.mj-hand { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end; min-height: 44px; }
.mj-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mj-actions:empty { display: none; }
.mj-btn { min-height: var(--tap); padding: 0 14px; }

/* ---------------------------------------------------------------- 结算与提示 */
.mj-result:empty { display: none; }
.mj-banner {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--win-soft);
  color: var(--win);
  font-size: 13px; font-weight: 600;
}
.mj-hint { font-size: 12px; text-align: center; min-height: 16px; }

/* ============================================================ 骨牌（web/js/games/dominoes.js）
   牌桌：中央骨牌链 + 自家手牌 + 各家牌数 */
.dm-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dm-pile { display: flex; align-items: center; gap: 6px; }
.dm-pile-count { font-weight: 700; color: var(--text); }
.dm-back { display: inline-flex; width: 18px; height: 36px; }
.dm-back svg, .dm-back img { display: block; width: 100%; height: 100%; }

/* 中央牌链：横向可滚，两端各挂一个"可接点数"的端帽 */
.dm-board {
  overflow-x: auto;
  padding: 10px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dm-chain-row { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 96px; }
.dm-cap {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.dm-chain { display: flex; align-items: center; gap: 2px; }
.dm-slot { display: flex; align-items: center; }
.dm-tile {
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.dm-tile.is-v { width: 38px; height: 76px; }
.dm-tile.is-h { width: 76px; height: 38px; }
.dm-tile-img, .dm-tile svg { display: block; width: 100%; height: 100%; }
.dm-ends { text-align: center; font-size: 12px; }

.dm-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.dm-player {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dm-player .p-name { flex: 1 1 auto; }
.dm-player.is-turn { border-color: var(--brand); background: var(--brand-soft); }
.dm-player.is-win { border-color: var(--win); background: var(--win-soft); font-weight: 600; }

/* 自家手牌：可点的牌描边高亮，接不上的压暗但依然能点（点了会看到提示） */
.dm-hand { display: flex; flex-wrap: wrap; gap: 6px; }
.dm-tile-btn {
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.dm-tile-btn .dm-tile { background: transparent; border: 0; box-shadow: none; }
.dm-tile-btn.playable { border-color: var(--brand); }
.dm-tile-btn.playable:hover { transform: translateY(-3px); }
.dm-tile-btn.dimmed { opacity: .45; cursor: default; }

.dm-side { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dm-side-btn {
  min-height: 32px;
  padding: 2px 10px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dm-side-btn.is-on { color: var(--brand); font-weight: 600; background: var(--brand-soft); border-color: var(--brand); }
.dm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dm-hint { text-align: center; font-size: 13px; }

@media (max-width: 560px) {
  .dm-tile.is-v { width: 32px; height: 64px; }
  .dm-tile.is-h { width: 64px; height: 32px; }
  .dm-cap { width: 34px; height: 34px; }
}

/* Card tables: a natural fan, complete battlefield cards and readable inspection. */
.hand.fan-hand {
  align-items: center; justify-content: safe center; gap: 0;
  min-height: 224px; padding: 52px 24px 34px;
  isolation: isolate; scroll-snap-type: none;
}
.fan-hand > button {
  width: clamp(84px, 12vw, 108px); flex: none;
  transform: translateY(var(--fan-lift, 0px)) rotate(var(--fan-angle, 0deg));
  transform-origin: center 135%; transition: transform .18s ease, filter .18s ease;
  position: relative;
}
.fan-hand > button:hover, .fan-hand > button:focus-visible {
  transform: translateY(-25px) rotate(0deg) scale(1.12); z-index: 100 !important;
}
.fan-hand > .card-unplayable, .fan-hand > .dim { opacity: .85; filter: none; }
.mb-creatures { gap: 12px; padding: 8px 4px; }
.mb-creature {
  display: block; position: relative; width: clamp(90px, 12vw, 116px); min-width: 0;
  padding: 0; border: 2px solid transparent; border-radius: 12px;
  background: transparent; box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.mb-creature > svg { width: 100%; height: auto; display: block; border-radius: 10px; }
.mb-creature.sick { opacity: .88; border-style: solid; }
.mb-creature.is-atk { outline: 3px solid var(--danger); outline-offset: 2px; background: transparent; }
.mb-creature.is-blk { outline: 3px solid var(--brand); outline-offset: 2px; background: transparent; }
.mb-creature .mb-block-tag { position: absolute; bottom: -5px; left: 5px; }
.card-detail {
  position: fixed; z-index: 150; display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: 16px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  pointer-events: none; max-height: calc(100dvh - 24px); overflow: hidden;
}
.card-detail-visual, .card-detail-visual:disabled {
  display: block; flex: 0 0 128px; width: 128px; padding: 0; border: 0; min-height: 0;
  opacity: 1; background: transparent; box-shadow: none; transform: none; filter: none;
}
.card-detail-visual img, .card-detail-visual svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.card-detail-copy { min-width: 0; font-size: 14px; line-height: 1.6; }
.card-detail-copy p { margin: 8px 0 0; }
.card-detail-stats { color: var(--brand); font-weight: 600; margin-top: 6px; }
.hand-reference { color: var(--text-2); padding: 4px 2px; }
.hand-reference summary { cursor: pointer; font-size: 13px; }
.hand-reference-row { border-top: 1px solid var(--border); padding: 10px 0; }
.hand-reference-row p { margin: 4px 0 0; font-size: 13px; }
.game-area[data-table='dark'] .hand-reference { color: #e4efe8; }
.game-area[data-table='dark'] .hand-reference-row { border-color: rgba(255,255,255,.22); }
.game-area[data-table='dark'] .empty { color: #bed2c7; }
.settlement-table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 14px; }
.settlement-table th, .settlement-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
.settlement-table tr[data-outcome='win'] { color: var(--brand); font-weight: 700; }
.leave-confirm .modal { max-width: 400px; }
@media (max-width: 560px) {
  .hand.fan-hand { min-height: 194px; padding: 42px 16px 30px; }
  .fan-hand > button { width: 86px; }
  .mb-creatures { gap: 8px; }
  .mb-creature { width: 92px; }
}

.sticker-img.asset-img{object-fit:contain}
#app .emoji-panel.room-popover{padding:9px;overflow:hidden;--sticker-icon:clamp(36px,min(20dvw,15dvh),72px)}
#app .emoji-panel.room-popover .emoji-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding-right:40px;margin:0 0 6px}
#app .emoji-panel.room-popover :is(.emoji-tab,.room-popover-close){height:34px;min-height:34px;margin:0}
#app .emoji-panel.room-popover .room-popover-close{position:absolute;top:9px;right:9px;width:34px}
#app .emoji-panel .sticker-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
#app .emoji-panel .sticker-btn{min-width:0;padding:3px 1px;gap:1px}
#app .emoji-panel .sticker-img{width:min(100%,var(--sticker-icon));height:var(--sticker-icon)}
#app .emoji-panel .sticker-btn>span:not(.sticker-img){font-size:10px;line-height:14px;white-space:nowrap}
@media (max-height:480px){
  #app .emoji-panel .sticker-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
  #app .emoji-panel.room-popover{--sticker-icon:clamp(30px,13.5dvh,54px)}
}
.avatar-reaction-layer{position:fixed;inset:0;z-index:201;pointer-events:none}
.avatar-reaction{position:absolute;translate:-50% -50%;pointer-events:none}
.sticker-reaction{width:var(--reaction-size);height:var(--reaction-size);object-fit:contain}
.avatar-effect{font-size:calc(var(--reaction-size)*.67);animation:avatar-effect-pop 1.3s both}
.effect-clock{animation-name:avatar-effect-ring}
.effect-confetti,.effect-sparkle{animation-name:avatar-effect-rise}
.avatar-effect.reaction-projectile{animation:none;font-size:clamp(24px,calc(var(--reaction-size)*.48),52px);filter:drop-shadow(0 3px 4px #17213288)}
.reaction-impact{width:var(--reaction-size);height:var(--reaction-size);display:grid;place-items:center}
.reaction-impact>span{grid-area:1/1;line-height:1;font-size:calc(var(--reaction-size)*.25);animation:reaction-scatter .85s ease-out both;color:#ffdc77;text-shadow:0 1px 3px #45261590}
.reaction-impact>span:first-child{font-size:calc(var(--reaction-size)*.76);animation:reaction-impact-pop .85s ease-out both}
.impact-egg>span:first-child{width:76%;height:55%;border-radius:58% 42% 69% 31% / 56% 68% 32% 44%;background:radial-gradient(ellipse at 51% 48%,#ffca3e 0 29%,#ffae24 30% 35%,#fff8dd 37%);box-shadow:0 2px 6px #45261588}
.impact-flower>span:not(:first-child){color:#ff9cb5}
@keyframes reaction-impact-pop{0%{scale:.25;opacity:.5}25%{scale:1.16;opacity:1}65%{scale:1;opacity:1}100%{scale:.94;opacity:0}}
@keyframes reaction-scatter{0%{scale:.3;opacity:0}25%{opacity:1}100%{translate:calc(cos(var(--angle))*var(--reaction-size)*.82) calc(sin(var(--angle))*var(--reaction-size)*.82);rotate:65deg;opacity:0}}
.avatar-reaction-menu.room-popover{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:8px!important;overflow:visible}
#app .avatar-reaction-menu.room-popover .avatar-reaction-choice{display:grid;place-items:center;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:1px solid #d6d5c8;border-radius:50%;background:#fffdf7;font:24px/1 system-ui;cursor:pointer}
#app .avatar-reaction-menu.room-popover .avatar-reaction-choice:hover{background:#fff1c8}
#app .avatar-reaction-menu.room-popover .room-popover-close{display:none}
#app .game-area [data-reaction-trigger]{cursor:pointer;pointer-events:auto}
@keyframes avatar-effect-pop{0%{scale:.35;opacity:0}25%{scale:1.25;opacity:1}70%{scale:1}100%{scale:.95;opacity:0}}
@keyframes avatar-effect-ring{0%,60%{rotate:-15deg}15%,45%{rotate:15deg}30%{rotate:-15deg}100%{rotate:0deg;opacity:0}}
@keyframes avatar-effect-rise{0%{transform:translateY(30%) scale(.65);opacity:0}35%{opacity:1}100%{transform:translateY(-55%) scale(1.25);opacity:0}}
@media(prefers-reduced-motion:reduce){.avatar-effect,.reaction-impact>span{animation:none}.reaction-impact>span:not(:first-child){display:none}}
