/* 游戏文字紧急修复 - 使用最高优先级规则 */

/* 游戏卡片样式 - 保持原来的文字颜色，只改外边框 */
.game-card,
.game-card[style*="background"],
.matching-game .game-card,
[data-theme="dark"] .game-card {
  background: #ffffff !important; /* 纯白色背景 */
  background-color: #ffffff !important;
  border: 3px solid #4a90e2 !important;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5) !important;
  border-radius: 10px !important;
  font-weight: 900 !important;
  font-size: 18px !important;
  color: #000000 !important; /* 确保文字为黑色 */
  text-shadow: none !important; /* 移除可能的文字阴影 */
}

/* 保持卡片内部元素正常显示，透明背景 */
.game-card *,
.game-card[style*="background"] *,
.matching-game .game-card *,
[data-theme="dark"] .game-card *,
.game-card > *,
.game-card span,
.game-card div,
.game-card p {
  background: transparent !important;
  background-color: transparent !important;
  opacity: 1 !important;
  font-weight: 900 !important;
  color: #000000 !important; /* 确保所有文本为黑色 */
  text-shadow: none !important; /* 移除可能的文字阴影 */
}

/* 使单词连连看游戏中的单词更加醒目 */
.game-card[data-type="word"],
.game-card[data-type="meaning"] {
  background: #ffffff !important; /* 纯白色背景 */
  background-color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 20px !important; /* 增大字体 */
  padding: 15px !important;
  border: 3px solid #4a90e2 !important;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5) !important;
  border-radius: 10px !important;
  color: #000000 !important; /* 确保文字为黑色 */
  text-shadow: none !important; /* 移除可能的文字阴影 */
}

/* 匹配状态的卡片样式 */
.game-card.matched,
.game-card.selected,
[data-theme="dark"] .game-card.matched,
[data-theme="dark"] .game-card.selected {
  background-color: #e6ffef !important;
  border-color: #38a169 !important;
  border-width: 3px !important;
  box-shadow: 0 0 10px rgba(56, 161, 105, 0.5) !important;
  font-weight: 900 !important;
  color: #000000 !important; /* 确保文字为黑色 */
}

/* 游戏卡片内的文本元素样式 */
.game-card .card-text,
.game-card .card-meaning,
.game-card .card-word,
.game-card .card-title,
[data-theme="dark"] .game-card .card-text,
[data-theme="dark"] .game-card .card-meaning,
[data-theme="dark"] .game-card .card-word,
[data-theme="dark"] .game-card .card-title {
  font-weight: 900 !important;
  opacity: 1 !important;
  color: #000000 !important; /* 确保文字为黑色 */
  text-shadow: none !important; /* 移除可能的文字阴影 */
  letter-spacing: 0.5px !important; /* 增加字母间距 */
}

/* 游戏卡片匹配状态元素样式 */
.game-card.matched *,
.game-card.selected *,
[data-theme="dark"] .game-card.matched *,
[data-theme="dark"] .game-card.selected * {
  font-weight: 900 !important;
  color: #000000 !important; /* 确保文字为黑色 */
}

/* 清除所有可能的透明度设置 */
.game-card,
.game-card *,
.matching-game *,
.game-selection * {
  opacity: 1 !important;
}

/* 更高对比度的卡片样式，特别针对暗色模式 */
[data-theme="dark"] .game-card {
  background: #ffffff !important; /* 纯白色背景 */
  background-color: #ffffff !important;
  border: 4px solid #5e9efa !important; /* 更粗更亮的边框色 */
  box-shadow: 0 0 20px rgba(94, 158, 250, 0.8) !important; /* 更明显的阴影 */
}

/* 游戏容器内的标题和描述文本保持原来颜色 */
.matching-game h2,
.matching-game h3,
.matching-game p,
.game-selection h2,
.game-selection h3,
.game-selection p,
.game-selection li,
.game-instructions,
.game-score,
.game-results,
.game-message,
.game-option-text,
[data-theme="dark"] .matching-game h2,
[data-theme="dark"] .matching-game h3,
[data-theme="dark"] .matching-game p,
[data-theme="dark"] .game-selection h2,
[data-theme="dark"] .game-selection h3,
[data-theme="dark"] .game-selection p,
[data-theme="dark"] .game-selection li,
[data-theme="dark"] .game-instructions,
[data-theme="dark"] .game-score,
[data-theme="dark"] .game-results,
[data-theme="dark"] .game-message,
[data-theme="dark"] .game-option-text {
  color: var(--text-primary) !important;
  text-shadow: none !important;
  font-weight: bold !important;
  opacity: 1 !important;
}

/* 暗色模式下游戏容器的背景颜色调整 */
[data-theme="dark"] .game-container,
[data-theme="dark"] .matching-game,
[data-theme="dark"] .game-selection,
[data-theme="dark"] .game-board {
  background-color: #1a1a1a !important; /* 更深的背景色，增加与卡片的对比度 */
}

/* 强制确保没有CSS规则能覆盖我们的文本颜色设置 */
[data-theme="dark"] .game-card,
[data-theme="dark"] .game-card *,
[data-theme="dark"] .game-card[data-type="word"],
[data-theme="dark"] .game-card[data-type="meaning"],
[data-theme="dark"] .game-card span,
[data-theme="dark"] .game-card div,
[data-theme="dark"] .game-card p,
[data-theme="dark"] .game-card .card-text,
[data-theme="dark"] .game-card .card-meaning,
[data-theme="dark"] .game-card .card-word,
[data-theme="dark"] .game-card .card-title {
  color: #000000 !important;
  text-shadow: none !important;
  font-weight: 900 !important;
  background-color: #ffffff !important;
}

/* 添加针对所有可能的文本元素的样式 */
.game-card:after,
.game-card:before,
.game-card > span,
.game-card > div,
.game-card > p,
.game-card > a,
.game-card .text,
.game-card .word,
.game-card .meaning,
.game-card .definition,
.game-card .translation,
.game-card .content,
.game-card .inner,
.game-card .inner-text,
.game-card[style*="color"],
.game-card[data-word],
.game-card[data-meaning],
[data-theme="dark"] .game-card:after,
[data-theme="dark"] .game-card:before,
[data-theme="dark"] .game-card > span,
[data-theme="dark"] .game-card > div,
[data-theme="dark"] .game-card > p,
[data-theme="dark"] .game-card > a,
[data-theme="dark"] .game-card .text,
[data-theme="dark"] .game-card .word,
[data-theme="dark"] .game-card .meaning,
[data-theme="dark"] .game-card .definition,
[data-theme="dark"] .game-card .translation,
[data-theme="dark"] .game-card .content,
[data-theme="dark"] .game-card .inner,
[data-theme="dark"] .game-card .inner-text,
[data-theme="dark"] .game-card[style*="color"],
[data-theme="dark"] .game-card[data-word],
[data-theme="dark"] .game-card[data-meaning] {
  color: #000000 !important;
  text-shadow: none !important;
  opacity: 1 !important;
  font-weight: 900 !important;
  text-decoration: none !important;
  background-color: transparent !important;
  -webkit-text-fill-color: #000000 !important; /* 针对WebKit浏览器 */
}

/* 移除所有可能影响文本显示的属性 */
.game-card,
.game-card *,
[data-theme="dark"] .game-card,
[data-theme="dark"] .game-card * {
  mix-blend-mode: normal !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-filter: none !important;
  clip-path: none !important;
  mask: none !important;
  -webkit-mask: none !important;
  text-emphasis: none !important;
  visibility: visible !important;
  display: block !important;
}

/* 单词连连看游戏特定样式 */
.game-item,
[data-theme="dark"] .game-item {
  background: #ffffff !important;
  border: 3px solid #4a90e2 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  margin: 8px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.game-item-inner,
[data-theme="dark"] .game-item-inner {
  background: #ffffff !important;
  padding: 10px !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.game-item-content,
[data-theme="dark"] .game-item-content {
  color: #000000 !important;
  font-size: 18px !important;
  font-weight: bold !important;
  text-align: center !important;
  text-shadow: none !important;
  background-color: #ffffff !important;
  padding: 10px !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.game-item.selected,
[data-theme="dark"] .game-item.selected {
  border-color: #ff9800 !important;
  box-shadow: 0 0 15px rgba(255,152,0,0.6) !important;
  transform: scale(1.05) !important;
}

.game-item.matched,
[data-theme="dark"] .game-item.matched {
  border-color: #4caf50 !important;
  background-color: #e8f5e9 !important;
  box-shadow: 0 0 15px rgba(76,175,80,0.6) !important;
}

.game-item.matched .game-item-content,
[data-theme="dark"] .game-item.matched .game-item-content {
  color: #2e7d32 !important;
  background-color: #e8f5e9 !important;
}

/* 暗色模式下的游戏容器样式 */
[data-theme="dark"] #word-matching-game {
  background-color: #1a1a1a !important;
  color: #ffffff !important;
  border: 1px solid #333333 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}

/* 游戏标题和计分区域 */
[data-theme="dark"] .game-header h3,
[data-theme="dark"] .game-stats,
[data-theme="dark"] .game-stats span,
[data-theme="dark"] .word-source {
  color: #ffffff !important;
  text-shadow: none !important;
}

/* 退出按钮 */
[data-theme="dark"] #game-exit-btn {
  background-color: #444444 !important;
  color: #ffffff !important;
  border: 1px solid #666666 !important;
}
