/* ===== 谁是卧底·合并页样式（oped 式浅色主题）=====
   核心手法：在 body.wodi-view 上重定义 CSS 变量，让 style.css / game.css 中
   所有用 var() 的元素（卡片 / 表格 / 弹窗 / 表单 / 按钮）自动变成浅色，
   无需逐个覆盖。再补头部布局与右上角「功能」下拉菜单的样式。 */

body.wodi-view {
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --card-hover: #f1f5f9;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #1e293b;
  min-height: 100vh;
}

/* 容器 */
.wodi-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
}

/* ===== 头部（仿 oped-header）===== */
.wodi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.wodi-view .header-left h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1e293b;
}

.header-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.header-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== 右上角「功能」下拉菜单 ===== */
.func-menu {
  position: relative;
}

.func-menu-trigger {
  display: inline-flex;
  align-items: center;
}

.func-menu.open .func-menu-trigger {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.func-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  padding: 0.4rem;
  z-index: 600;
}

.func-menu.open .func-menu-dropdown {
  display: block;
}

.func-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.85rem;
  border: none;
  background: transparent;
  color: #1e293b;
  font-size: 0.92rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.func-menu-item:hover:not(:disabled) {
  background: #f1f5f9;
}

.func-menu-item:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.func-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.35rem 0.5rem;
}

/* ===== 浅色主题下的卡片阴影更柔和（game.css 默认阴影偏重）===== */
.wodi-view .game-table-wrapper {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow-x: auto; /* 内容横向溢出时的兜底滚动 */
}

/* ===== 多轮发言·横向拖拽（手机竖屏轮次多时）=====
   fitTableScroll() 判定表格自然宽超过容器后给 wrapper 加 .is-scrollable：
   表格被撑开超过 100%，容器横向滚动；首列（玩家）sticky 钉在左侧，
   向右拖动即可看到后面的轮次，而不会丢掉「是谁在发言」。
   sticky 单元格必须有不透明底色（行底色画在 tr 上，默认 td 透明会透出后续列）。 */
.wodi-view .game-table-wrapper.is-scrollable thead th.col-player,
.wodi-view .game-table-wrapper.is-scrollable tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card-bg); /* 与卡片底色一致，盖住滚到下面的轮次 */
  /* 右缘投影：提示「右侧还有内容、可继续拖动」 */
  box-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.18);
}
/* 表头压在 body 之上，且底色用 thead 的 card-hover 与之统一 */
.wodi-view .game-table-wrapper.is-scrollable thead th.col-player {
  z-index: 3;
  background: var(--card-hover);
}
/* sticky 首列底色随行态变化（hover / 死亡 / 出局），避免拖动时透色错位 */
.wodi-view .game-table-wrapper.is-scrollable tbody tr:hover td:first-child {
  background: var(--card-hover);
}
.wodi-view .game-table-wrapper.is-scrollable tbody tr.is-dead td:first-child,
.wodi-view .game-table-wrapper.is-scrollable tbody tr.is-dead:hover td:first-child {
  background: #edc4c8; /* 取该行玫粉渐变的左端色 */
}
.wodi-view .game-table-wrapper.is-scrollable tbody tr.is-voted-out td:first-child,
.wodi-view .game-table-wrapper.is-scrollable tbody tr.is-voted-out:hover td:first-child {
  background: #e3e6eb; /* 取该行浅灰渐变的左端色 */
}

/* 收紧对局表行距（仅压上下 padding，左右沿用基础 / 响应式值） */
.wodi-view .game-table td {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

/* 弹窗遮罩在浅色页面下更柔和 */
.wodi-view .modal {
  background: rgba(15, 23, 42, 0.5);
}

/* ===== 批量加玩家 / 随机分配角色 弹窗 ===== */
.player-checkbox-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

/* 复选框行：覆盖 list-item 的 space-between，让勾选框+名字靠左排列 */
.player-pick {
  justify-content: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.player-pick input[type=checkbox] {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  cursor: pointer;
}

.player-pick-name {
  flex: 1;
}

/* 「管理本局玩家」勾选行：已勾选（参与本局）高亮，便于一屏区分参与 / 不参与的玩家 */
.player-pick.is-selected {
  background: #eff6ff;
  border-color: var(--primary);
}

/* 「管理本局玩家」工具条：全选 / 全不选 + 参与人数摘要（靠右） */
.manage-players-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.manage-players-summary {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* 角色配比行里的数量输入框收窄 */
.assign-count {
  width: 5rem;
  flex-shrink: 0;
  text-align: center;
}

/* 弹窗内提示行（合计 X / Y 名玩家） */
.form-hint {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.assign-mismatch {
  color: var(--bad-faction);
  font-weight: 600;
}

/* ===== 分配角色弹窗：指定玩家身份（钉选）区块 ===== */
.assign-fixed {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: var(--card-hover);
}

.assign-fixed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.assign-fixed-title {
  font-weight: 600;
  color: var(--text, #1e293b);
}

.assign-fixed-hint {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* 钉选下拉与添加按钮挤在一行，下拉自适应伸展 */
.assign-fixed .form-row {
  margin-bottom: 0.5rem;
}

.assign-fixed .form-row .form-select {
  flex: 1;
  min-width: 7rem;
}

.assign-fixed-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.assign-fixed-item .list-item-info {
  gap: 0.5rem;
}

.assign-fixed-name {
  font-weight: 600;
  color: var(--text, #1e293b);
}

.assign-fixed-arrow {
  color: var(--text-light);
}

.assign-fixed-summary {
  color: var(--primary, #3B82F6);
  font-weight: 600;
}

/* ===== 游戏规则弹窗：按阵营分组的角色明细卡（自动生成·纯展示） ===== */
.rules-role-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.rules-faction-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rules-faction-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}
.faction-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.rules-role-card {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--card-bg);
}
.rules-role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.rules-role-meta {
  font-size: 0.85rem;
  color: var(--text-light);
}
.rules-role-desc {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere; /* 长串连续字符也能在任意处折行，并修正 flex 子项最小宽度，防止规则介绍撑破卡片框 */
  line-height: 1.6;
  color: var(--text);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

/* 角色列表里的规则介绍：完整多行展示（保留输入换行 + 长串也能折行） */
.list-item-desc {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .wodi-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-left {
    width: 100%;
  }

  .header-right {
    justify-content: flex-end;
  }

  .func-menu-dropdown {
    left: 0;
    right: 0;
  }
}

/* ===== 当前场次排行榜：头像 + 累计分 ===== */
.quick-score-list .player-avatar {
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
}

/* ===== 历史页（/wodi/history）双栏布局 ===== */
.history-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.history-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.history-sidebar-title {
  font-size: 1rem;
  color: var(--text-light);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.history-session-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-session-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
}

.history-session-card:hover {
  background: var(--bg);
}

.history-session-card.is-selected {
  border-color: var(--primary);
  background: #eff6ff;
}

.history-session-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-session-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-session-card-actions {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}

.history-session-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.15rem 0.3rem;
  border-radius: 6px;
  color: var(--text-light);
  line-height: 1;
}

.history-session-icon-btn:hover {
  background: var(--border);
}

.history-session-icon-btn.danger:hover {
  background: #fee2e2;
}

.history-session-card-meta {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.35rem;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.history-session-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
  white-space: nowrap;
}

.history-session-badge.is-current {
  background: #dbeafe;
  color: #1d4ed8;
}

.history-main {
  min-width: 0;
}

.history-detail-header {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.history-detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.history-detail-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-light);
}

.history-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.history-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--text);
}

.history-rankings {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-games {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.history-game-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--bg);
}

.history-game-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.history-game-no {
  font-weight: 700;
  color: var(--text);
}

.history-game-faction {
  font-weight: 600;
  font-size: 0.9rem;
}

.history-game-faction.is-active {
  color: var(--text-light);
  font-weight: 500;
}

.history-game-words {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  margin-bottom: 0.6rem;
}

.history-game-word.good {
  color: #16a34a;
}

.history-game-word.bad {
  color: #dc2626;
}

.history-game-word.blank {
  color: #d97706;
}

.history-game-bank {
  color: var(--text-light);
  font-size: 0.8rem;
}

.history-game-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history-game-player {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem 0.2rem 0.3rem;
  font-size: 0.85rem;
}

.history-game-player .player-avatar {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.history-game-player .avatar-text {
  font-size: 0.7rem;
}

.history-game-player .avatar-text.is-2 {
  font-size: 0.65rem;
}

.history-game-player-name {
  font-weight: 600;
  color: var(--text);
}

/* 历史页响应式：窄屏单栏，侧栏不再吸顶 */
@media (max-width: 860px) {
  .history-layout {
    grid-template-columns: 1fr;
  }

  .history-sidebar {
    position: static;
    max-height: none;
  }
}

/* ===== 角色配置：内联「默认数量」输入（与场次/局无关，用于预填随机分配弹窗）===== */
.role-count-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.role-count-label {
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
}

.role-count-input.form-input {
  width: 4rem;
  padding: 0.2rem 0.4rem;
  text-align: center;
}

/* ===== 玩家「死亡」标记（管理员可切换；全员可见：柔和玫粉行 + 骷髅头）=====
   纯展示标记，不影响积分 / 结算。浅玫粉渐变行 + 深酒红文字 + 头像轻灰度，
   对比柔和、不突兀，仍能清楚识别「已出局」。 */
.game-table tbody tr.is-dead,
.game-table tbody tr.is-dead:hover {
  background: linear-gradient(90deg, #edc4c8 0%, #f1cfd2 55%, #f5d9dc 100%);
}

.game-table tbody tr.is-dead td {
  color: #7a3339;
}

.game-table tbody tr.is-dead .player-name {
  color: #8a2f36;
  text-decoration: line-through;
  text-decoration-color: rgba(122, 51, 57, 0.45);
}

/* ===== 「新游戏」选词：分组单选列表（未玩过 / 已玩过置灰但可选）=====
   是否「玩过」由后端按 game_rounds 关联实时判断；删除场次会级联删局，
   词库随即变回未玩过。已玩过行仅视觉置灰，仍可点选开局。 */
.word-bank-pick-list {
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* 分组小标题：未玩过 / 已玩过 */
.word-bank-group-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 0.35rem 0.25rem 0.1rem;
}

.word-bank-group-title:not(:first-child) {
  margin-top: 0.4rem;
}

/* 单选行：隐藏原生 radio，用左侧圆点 + 词库名 + 词详情 */
.word-pick {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.word-pick:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.word-pick input[type=radio] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* 自定义圆点 */
.word-pick-radio {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.word-pick-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}

.word-pick-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.word-pick-detail {
  font-size: 0.82rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 选中态：边框高亮 + 圆点实心 */
.word-pick.is-selected {
  border-color: var(--primary);
  background: #eff6ff;
}

.word-pick.is-selected .word-pick-radio {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 3px #fff;
}

/* 已玩过：置灰（仍可选；选中时恢复不透明度让高亮清晰） */
.word-pick.is-played {
  opacity: 0.55;
}

.word-pick.is-played.is-selected {
  opacity: 1;
}

/* 选词列表行尾的「已玩」小标 */
.word-played-tag {
  flex-shrink: 0;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-light);
}

/* 词库管理弹窗里的「已玩 / 未玩」状态标 */
.word-status-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.word-status-tag.is-fresh {
  background: rgba(34, 197, 94, 0.18);
  color: var(--good-faction);
}

.word-status-tag.is-played {
  background: var(--border);
  color: var(--text-light);
}

/* 头像轻灰度，弱化「已出局」玩家（不过度压暗）*/
.game-table tbody tr.is-dead .player-avatar {
  filter: grayscale(0.55) brightness(0.98);
  opacity: 0.85;
}

/* 天使双词：缩字号 + 收窄左右内边距，尽量一行放下；不强制 nowrap——硬不换行会溢出单元格。
   词太长时在框内整齐折行（line-height 收紧），不再顶到旁边发言列。*/
.word-display.is-dual {
  font-size: 0.8rem;
  line-height: 1.35;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* 词 / 发言：浅白半透明抬起来，避免在玫粉底上糊成一团 */
.game-table tbody tr.is-dead .word-display,
.game-table tbody tr.is-dead .speech-content {
  background: rgba(255, 255, 255, 0.5);
  color: #864148;
  border-color: rgba(122, 51, 57, 0.2);
}

.game-table tbody tr.is-dead .speech-content.empty {
  color: rgba(122, 51, 57, 0.5);
  font-style: italic;
}

.game-table tbody tr.is-dead .role-badge {
  opacity: 0.82;
}

/* 死亡骷髅头标记（玩家名右侧，死亡时非管理员可见）*/
.death-mark {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(122, 51, 57, 0.35));
}

/* 管理员·死亡切换按钮（玩家名右侧，存活态显 💀、死亡态显「复活」）*/
.btn-death {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 999px;
  border: 1px dashed #cbd5e1;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn-death:hover {
  background: #f1f5f9;
  border-color: #f87171;
  color: #dc2626;
}
.btn-death:active { transform: scale(0.94); }

/* 死亡行内的按钮：在浅玫粉底上用实线酒红描边，便于识别「复活」态 */
.game-table tbody tr.is-dead .btn-death {
  border-style: solid;
  border-color: rgba(122, 51, 57, 0.4);
  color: #7a3339;
  background: rgba(255, 255, 255, 0.55);
}
.game-table tbody tr.is-dead .btn-death:hover {
  background: #fff;
  border-color: #b5474e;
  color: #6a262d;
}

/* ===== 玩家「被投票出局」标记（管理员可切换；全员可见：浅灰行 + 非管理员标记位揭晓真实身份）=====
   与「死亡」并列的另一类出局：出局即向全员公开该玩家真实身份（非管理员「标记」位变成只读的
   真实身份徽章），并把整行压成浅灰。不影响积分 / 结算。定义在 is-dead 之后，两态并存时浅灰优先。 */
.game-table tbody tr.is-voted-out,
.game-table tbody tr.is-voted-out:hover {
  background: linear-gradient(90deg, #e3e6eb 0%, #e8eaef 55%, #edeef2 100%);
}
.game-table tbody tr.is-voted-out td {
  color: #6b7280;
}
.game-table tbody tr.is-voted-out .player-name {
  color: #4b5563;
}
.game-table tbody tr.is-voted-out .player-avatar {
  filter: grayscale(0.7) brightness(0.97);
  opacity: 0.8;
}
.game-table tbody tr.is-voted-out .word-display,
.game-table tbody tr.is-voted-out .speech-content {
  background: rgba(255, 255, 255, 0.55);
  color: #6b7280;
  border-color: rgba(107, 114, 128, 0.2);
}
.game-table tbody tr.is-voted-out .speech-content.empty {
  color: rgba(107, 114, 128, 0.55);
  font-style: italic;
}
.game-table tbody tr.is-voted-out .role-badge {
  opacity: 0.88;
}

/* 非管理员·揭晓的真实身份徽章：复用 role-badge 阵营配色，叠虚线灰框表明「已锁定 / 揭晓」 */
.role-badge.revealed-mark {
  margin-left: 0.4rem;
  cursor: default;
  border: 1px dashed rgba(75, 85, 99, 0.6);
  box-shadow: none;
}

/* 管理员·投票出局切换按钮（玩家名右侧，未出局显 🗳、已出局显「撤销出局」）*/
.btn-voted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 999px;
  border: 1px dashed #cbd5e1;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn-voted:hover {
  background: #f1f5f9;
  border-color: #6366f1;
  color: #4f46e5;
}
.btn-voted:active { transform: scale(0.94); }

/* 出局行内的按钮：在浅灰底上用实线深灰描边，便于识别「撤销出局」态 */
.game-table tbody tr.is-voted-out .btn-voted {
  border-style: solid;
  border-color: rgba(75, 85, 99, 0.45);
  color: #4b5563;
  background: rgba(255, 255, 255, 0.6);
}
.game-table tbody tr.is-voted-out .btn-voted:hover {
  background: #fff;
  border-color: #374151;
  color: #374151;
}

/* ===== 禁言词横幅（对局页表格上方，管理员与非管理员都可见；词库未设禁言词时 JS 隐藏）===== */
.ban-word-banner {
  margin: 0 0 1rem;
  padding: 0.7rem 1.1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger, #ef4444);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
  color: var(--text, #1e293b);
}
/* 禁言词「XXX」高亮：红色加粗（与项目危险 / 禁言红色语义一致，仿 .word-status-tag 同色打法） */
.ban-word-banner .ban-highlight {
  color: var(--bad-faction, #ef4444);
  font-weight: 700;
}

/* 天使身份标签（紫色调，呼应 .my-word-banner.is-angel 的天使紫；供「我的词」横幅身份告知用） */
.tag-angel {
  background: rgba(139, 92, 246, 0.2);
  color: #7c3aed;
}

/* ===== 玩家登录后的「我的词」横幅（非管理员凭密钥登录时显示）=====
   顶部独立卡片：欢迎语 + 存活/已出局状态 + 自己的词（天使显示两个无标签词）。
   绝不显示角色名，只展示词与死亡状态。 */
.my-word-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1.1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary, #3B82F6);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* 天使双词态：换紫色侧条提示「特殊」 */
.my-word-banner.is-angel {
  border-left-color: #8B5CF6;
}

.my-word-banner .my-banner-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.my-word-banner .my-greet {
  font-weight: 700;
  color: var(--text, #1e293b);
  font-size: 1rem;
}

/* 存活 / 已出局状态徽章 */
.my-word-banner .my-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-light, #64748b);
}
.my-word-banner .my-status.is-dead {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}
.my-word-banner .my-status.is-voted {
  background: rgba(100, 116, 139, 0.16);
  color: #475569;
}

/* 词容器与词药丸（仿 .word-display 样） */
.my-word-banner .my-words {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.my-word-banner .my-word {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1e293b;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  white-space: nowrap;
}
/* 天使双词：两词同色、无标签（顺序随机，定时器原地交换文本） */
.my-word-banner.is-angel .my-word {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

.my-word-banner .my-angel-hint {
  font-size: 0.78rem;
  color: var(--text-light, #64748b);
}

/* 次要文案（暂无场次 / 等待开局 / 身份发放中 / 不在场次 / 场次已更换） */
.my-word-banner .my-hint {
  font-size: 0.9rem;
  color: var(--text-light, #64748b);
}

/* ===== 管理员·玩家密钥弹窗列表 ===== */
.player-keys-list {
  max-height: 420px;
  overflow-y: auto;
}

/* 密钥等宽大写，醒目易复制 */
.key-row .key-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--primary, #3B82F6);
  user-select: all;
}
.key-row .key-missing {
  font-size: 0.85rem;
  color: var(--text-light, #94a3b8);
  font-style: italic;
}

/* ===== 右侧悬浮钮（玩家 🗡️ / 管理员 📨）=====
   仿 oped .player-score-viewer：固定右侧垂直居中的圆钮；两钮按角色互斥显隐。 */
.wodi-fab {
  position: fixed;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  z-index: 500; /* 高于页面内容，低于弹窗(1000) */
}
.wodi-fab:hover {
  border-color: var(--primary, #6366f1);
  transform: translateY(-50%) translateY(-1px);
}
.wodi-fab-admin {
  font-size: 1.4rem;
}

/* 管理员钮右上角角标（请求数） */
.fab-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

@media (max-width: 600px) {
  .wodi-fab {
    right: 0.25rem;
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }
}

/* ===== 死亡/投票暂存条（表格下方，管理员 + active 局可见）===== */
.marks-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.9rem;
  background: #fff;
  border: 1px dashed #f59e0b;   /* 虚线橙框提示「暂存区」 */
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.marks-bar-summary {
  font-size: 0.88rem;
  color: var(--text-secondary, #64748b);
}
.marks-bar-actions {
  display: flex;
  gap: 0.5rem;
  flex: none;
}

/* 死亡/投票按钮的「暂存未保存」高亮：橙底 + 虚线描边，区别于已保存态 */
.btn-death.is-pending,
.btn-voted.is-pending {
  background: #fff7ed !important;
  border-style: dashed !important;
  border-color: #f59e0b !important;
  color: #b45309 !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
  animation: marks-pending-pulse 1.6s ease-in-out infinite;
}
@keyframes marks-pending-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18); }
  50%      { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28); }
}

/* ===== 玩家·暗中行动弹窗 ===== */
.action-target-list {
  max-height: 360px;
  overflow-y: auto;
}
.action-target {
  cursor: pointer;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}
.action-target:hover {
  background: #f8fafc;
}
.action-target input[type="radio"] {
  flex: none;
}
.action-target-name {
  font-weight: 500;
}
.action-target.is-me .action-target-name {
  color: var(--primary, #6366f1);
}
.action-me-tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary, #6366f1);
  border-radius: 6px;
  vertical-align: middle;
}
.action-buttons {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.action-buttons .action-btn {
  flex: 1;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
}
.action-cooldown {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: #b45309;
  text-align: center;
}

/* ===== 管理员·玩家请求弹窗 ===== */
.request-list {
  max-height: 460px;
  overflow-y: auto;
}
.request-row .list-item-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.request-content {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.request-action {
  font-weight: 700;
}
.request-target {
  font-weight: 600;
  color: var(--text, #1f2937);
}
.request-time {
  flex: none;
  font-size: 0.78rem;
  color: var(--text-light, #94a3b8);
  font-variant-numeric: tabular-nums;
}
