/* 已拆分，保留文件用于后续补充自定义样式 */

/* 图片懒加载相关样式 */
.lazy-loading {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.lazy-loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.lazy-error {
  opacity: 0.5;
  background: #f0f0f0;
  border: 1px dashed #ccc;
}

/* 图片加载动画 */
@keyframes image-loading {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

.image-loading {
  animation: image-loading 1s ease-in-out;
}

/* 回放功能相关样式 */
.game-over-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.replay-save-btn,
.back-to-room-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.replay-save-btn {
  background: #28a745;
  color: white;
}

.replay-save-btn:hover {
  background: #218838;
}

.back-to-room-btn {
  background: #6c757d;
  color: white;
}

.back-to-room-btn:hover {
  background: #5a6268;
}

/* 回放保存对话框 */
.replay-save-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.replay-save-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  min-width: 300px;
  max-width: 500px;
}

.replay-save-content h3 {
  margin: 0 0 15px 0;
  text-align: center;
  color: #333;
}

.replay-save-info {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.replay-save-info p {
  margin: 5px 0;
  font-size: 14px;
  color: #666;
}

.replay-save-input {
  margin-bottom: 15px;
}

.replay-save-input label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.replay-save-input input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.replay-save-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* 回放列表对话框 */
.replay-list-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.replay-list-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 80%;
  max-height: 80%;
  overflow-y: auto;
}

.replay-list-content h3 {
  margin: 0 0 15px 0;
  text-align: center;
  color: #333;
}

.no-replays {
  text-align: center;
  color: #666;
  padding: 40px;
  font-style: italic;
}

.replay-list {
  max-height: 400px;
  overflow-y: auto;
}

.replay-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #f8f9fa;
}

.replay-item:hover {
  background: #e9ecef;
}

.replay-item-info {
  flex: 1;
}

.replay-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.replay-meta {
  font-size: 12px;
  color: #666;
}

.replay-meta span {
  margin-right: 15px;
}

.replay-item-actions {
  display: flex;
  gap: 5px;
}

.replay-play-btn,
.replay-export-btn,
.replay-delete-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.replay-play-btn {
  background: #007bff;
  color: white;
}

.replay-play-btn:hover {
  background: #0056b3;
}

.replay-export-btn {
  background: #28a745;
  color: white;
}

.replay-export-btn:hover {
  background: #218838;
}

.replay-delete-btn {
  background: #dc3545;
  color: white;
}

.replay-delete-btn:hover {
  background: #c82333;
}

.replay-list-actions {
  text-align: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

#main-menu-desc {
  font-size: 14px;
  color: #000;
  margin-top: 10px;
  line-height: 1.4;
  text-shadow: 1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff,
    -1px 1px 1px #fff;
}

#main-menu h1 {
  text-shadow: 1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff,
    -1px 1px 1px #fff;
}

/* 卡组编辑器相关样式 */

.general-list-btn {
  display: inline-block;
  margin: 8px;
  padding: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ccc;
  transition: border 0.2s;
}

.general-list-btn.selected {
  border: 2px solid #0078d7;
}

.general-list-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.general-list-btn img {
  width: 80px;
  height: 112px;
  display: block;
}

.general-list-btn-label {
  font-size: 16px;
  padding: 4px;
}

.card-list-btn {
  margin: 8px;
  padding: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ccc;
  transition: border 0.2s;
}

.card-list-btn.selected {
  border: 2px solid #0078d7;
}

.card-list-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card-list-btn img {
  width: 80px;
  height: 112px;
  display: block;
}

.card-list-btn-label {
  font-size: 14px;
  padding: 4px;
  width: 72px;
  height: 36px;
  white-space: nowrap;
}

.card-list-count-info {
  margin: 8px 0;
  font-weight: bold;
  color: #0078d7;
}

/* 上传按钮样式 */
.upload-deck-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.upload-deck-btn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.upload-deck-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

#top-buttons {
  position: absolute;
  top: 0;
  left: 0;
  margin: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* 主菜单按钮样式 */
.main-menu-button {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #0078d7, #106ebe);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.4);
  transition: all 0.3s ease;
  border: 2px solid #fff;
  margin-bottom: 10px;
}

.main-menu-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 120, 215, 0.6);
  background: linear-gradient(135deg, #106ebe, #005a9e);
}

.main-menu-button:active {
  transform: scale(0.95);
}

.main-menu-icon {
  color: white;
  font-size: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.main-menu-button.expanded .main-menu-icon {
  transform: rotate(45deg);
}

/* 展开菜单样式 */
.expanded-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10000;
}

.expanded-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* 菜单项基础样式 */
.menu-item {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s ease;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.menu-item:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.menu-item:active {
  transform: scale(0.95);
}

/* 反馈按钮样式 */
.feedback-button {
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

.feedback-button:hover {
  box-shadow: 0 6px 16px rgba(211, 47, 47, 0.6);
  background: linear-gradient(135deg, #f44336, #d32f2f);
}

.feedback-icon {
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 在线玩家按钮样式 */
.online-players-button {
  background: #f0f0f0;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.online-players-button:hover {
  box-shadow: 0 6px 16px rgba(33, 150, 243, 0.6);
  background: linear-gradient(135deg, #42a5f5, #2196f3);
}

.online-players-icon {
  color: white;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 投降按钮样式 */
.top-surrender-button {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* 背景图上传按钮样式 */
.background-upload-button {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2);
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
}

.background-upload-button:hover {
  box-shadow: 0 6px 16px rgba(156, 39, 176, 0.6);
  background: linear-gradient(135deg, #ba68c8, #9c27b0);
}

.background-upload-icon {
  color: white;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.top-surrender-button:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  background: #f0f0f0;
}

.top-surrender-icon {
  color: #0078d7;
}

/* 音效开关按钮样式 */
.sound-toggle-button {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #4caf50, #388e3c);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  transition: all 0.3s ease;
  border: 2px solid #fff;
}

.sound-toggle-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.6);
  background: linear-gradient(135deg, #66bb6a, #4caf50);
}

.sound-toggle-button:active {
  transform: scale(0.95);
}

.sound-toggle-button.disabled {
  background: linear-gradient(135deg, #9e9e9e, #757575);
  box-shadow: 0 4px 12px rgba(158, 158, 158, 0.4);
}

.sound-toggle-button.disabled:hover {
  background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
  box-shadow: 0 6px 16px rgba(158, 158, 158, 0.6);
}

.sound-icon {
  color: white;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 等待响应消息样式 */
#waiting-response-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  z-index: 1000;
  font-size: 18px;
  font-weight: bold;
  max-width: 300px;
  backdrop-filter: blur(5px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#waiting-response-message.warning {
  background: rgba(255, 0, 0, 0.8);
}

#waiting-response-message > div:first-child {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: bold;
}

#waiting-response-message > div:last-child {
  color: #87ceeb;
  font-size: 16px;
  line-height: 1.4;
}

/* 背景图相关样式 */
body.custom-background {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

/* 背景图半透明遮罩层 */
body.custom-background::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.3);
  z-index: -1;
  pointer-events: none;
}

/* 游戏界面区域也显示背景图 */
body.custom-background #main-game-board {
  background: inherit !important;
  background-attachment: fixed !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  position: relative;
}

body.custom-background #main-game-board::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.3);
  z-index: 0;
  pointer-events: none;
  border-radius: 22px;
}

/* 确保游戏内容在遮罩层之上 */
body.custom-background #main-game-board > * {
  z-index: 1;
}

/* 战场区域也显示背景图 */
body.custom-background #battlefield > div {
  background: inherit !important;
  background-attachment: fixed !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  position: relative;
}

body.custom-background #battlefield > div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  z-index: 0;
  pointer-events: none;
  border-radius: 0 0 18px 18px;
}

/* 确保战场内容在遮罩层之上 */
body.custom-background #battlefield > div > * {
  position: relative;
  z-index: 1;
}

/* 背景图管理弹窗样式 */
#background-manager-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.background-manager-inner {
  background: white;
  border-radius: 12px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.background-preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin: 10px 0;
  border: 2px solid #ddd;
}

.background-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.background-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.background-apply-btn {
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
}

.background-apply-btn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-1px);
}

.background-remove-btn {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
}

.background-remove-btn:hover {
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  transform: translateY(-1px);
}

.background-upload-btn {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  color: white;
}

.background-upload-btn:hover {
  background: linear-gradient(135deg, #1976d2, #1565c0);
  transform: translateY(-1px);
}

.background-close-btn {
  background: #f0f0f0;
  color: #333;
}

.background-close-btn:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

/* 游戏结束消息样式 */
#game-over-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  z-index: 1000;
  font-size: 18px;
  font-weight: bold;
  backdrop-filter: blur(5px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#game-over-message > div:first-child {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: bold;
}

#game-over-message > div:last-child {
  color: #ffd700;
  font-size: 16px;
  line-height: 1.4;
}

/* VS区域回放控制样式 */
.replay-vs-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 100%;
  position: relative;
}

.replay-vs-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.replay-vs-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.replay-vs-btn:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.replay-vs-btn:active {
  transform: scale(0.95);
}

.replay-vs-center {
  width: 28px;
  height: 28px;
  font-size: 14px;
  background: rgba(255, 215, 0, 0.9);
}

.replay-vs-center:hover {
  background: #ffd700;
}

.replay-vs-progress {
  width: 250%;
  margin-top: -30px;
}

.replay-vs-seek-bar {
  height: 4px;
  background: rgb(81 0 255 / 20%);
  border-radius: 2px;
  cursor: pointer;
  appearance: none;
}

.replay-vs-seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #ffd700;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.replay-vs-seek-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #ffd700;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.replay-vs-info {
  font-size: 8px;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
