/* ==========================================================
   friberg.css · 弗一把专属样式
   依赖 tool-base.css（外壳/主题令牌）+ game-base.css（通用游戏组件/反馈色）
   仅含本游戏特有的表格比对与自动补全逻辑
   ========================================================== */

/* ========== 游戏表格 ========== */
.game-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--card);
  margin-bottom: 18px;
  max-height: 430px;
  overscroll-behavior-inline: contain;
}

.game-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: .78rem;
  min-width: 620px;
}

.game-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.game-table th {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 8px;
  text-align: center;
  font-weight: 400;
  letter-spacing: .08em;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.game-table td {
  padding: 10px 8px;
  text-align: center;
  border-top: 1px solid var(--line);
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
  transition: background .2s, color .2s;
}

.game-table td.name-cell {
  font-weight: 700;
  font-family: var(--serif);
}

/* 比对反馈色引用 game-base.css 的 --g-* 令牌 */
.game-table td.correct {
  background: var(--g-correct-soft);
  color: var(--g-correct);
}

.game-table td.close {
  background: var(--g-close-soft);
  color: var(--g-close);
}

.game-table td.wrong {
  background: var(--g-wrong-soft);
  color: var(--g-wrong-ink);
}

.game-table td .dir {
  display: inline-flex;
  vertical-align: -2px;
  margin-left: 4px;
  font-size: .85rem;
  color: var(--ink-2);
}

.game-table td.age-cell {
  font-variant-numeric: tabular-nums;
}

.game-table .empty-row td {
  background: transparent !important;
  color: var(--muted);
  font-family: var(--serif);
  font-size: .9rem;
  padding: 26px 8px;
}

/* ========== 自动补全下拉 ========== */
.autocomplete-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  background: var(--card);
  border: 1px solid var(--red);
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 18px 40px rgba(43, 37, 28, .18);
  z-index: 100;
  display: none;
}

.autocomplete-dropdown.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .78rem;
  transition: background .12s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--g-correct-soft);
}

.autocomplete-item .nick {
  font-weight: 600;
  color: var(--ink);
}

.autocomplete-item .extra {
  font-size: .74rem;
  color: var(--muted);
  margin-left: auto;
}

.autocomplete-item .extra .team-tag {
  background: var(--paper);
  padding: 2px 6px;
  border: 1px solid var(--line);
  font-size: .68rem;
}

/* ========== 标题描述 ========== */
/* 英文描述较长：取消 tool-base 在宽屏下的单行限制，
   让文本在即将超出下方分割线时自然换行（短文本仍为单行） */
.game-main .tool-headline p {
  white-space: normal;
}
