/*
 * 技能象棋对战 - 样式表
 * 古典风格配色方案
 */

:root {
  --primary-brown: #3d2817;      /* 深褐色 */
  --accent-gold: #c8a574;        /* 土黄色 */
  --board-bg: #d4a574;           /* 棋盘背景 */
  --board-border: #5c3d2e;       /* 棋盘边框 */
  --text-dark: #2a1f15;          /* 深色文字 */
  --text-light: #f5f1eb;         /* 浅色文字 */
  --red-piece: #8b3a2d;          /* 红棋 */
  --black-piece: #1a1410;        /* 黑棋 */
  --piece-bg: #e8dcc8;           /* 棋子背景 */
  --highlight: #5c3d2e;          /* 高亮色 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", "宋体", serif;
  background: linear-gradient(180deg, #2a1f15 0%, #1a1410 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  color: var(--text-light);
}

h1 {
  color: var(--accent-gold);
  margin-bottom: 30px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-container {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
}

.board-container {
  position: relative;
  background: linear-gradient(135deg, #d4a574 0%, #c8a574 100%);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 4px solid var(--board-border);
}

canvas {
  display: block;
  cursor: default;
  background: #eae4d5;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
  height: fit-content;
}

.info-panel {
  background: rgba(45, 35, 25, 0.95);
  padding: 16px;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(200, 165, 116, 0.2);
}

.info-panel h3 {
  color: var(--accent-gold);
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(200, 165, 116, 0.3);
  padding-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 14px;
}

.info-item span:first-child {
  font-weight: 500;
  color: var(--text-light);
  opacity: 0.8;
}

.info-item span:last-child {
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 16px;
}

button {
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-family: inherit;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-undo {
  background: linear-gradient(135deg, #8b6914 0%, #6b5410 100%);
  color: var(--text-light);
  border: 1px solid rgba(200, 165, 116, 0.3);
}

.btn-undo:hover:not(:disabled) {
  background: linear-gradient(135deg, #a07c1a 0%, #7b6b1a 100%);
  box-shadow: 0 4px 12px rgba(200, 165, 116, 0.3);
}

.btn-double {
  background: linear-gradient(135deg, #5c3d2e 0%, #3d2817 100%);
  color: var(--accent-gold);
  border: 1px solid rgba(200, 165, 116, 0.3);
}

.btn-double:hover:not(:disabled) {
  background: linear-gradient(135deg, #6b4a38 0%, #4a3420 100%);
  box-shadow: 0 4px 12px rgba(200, 165, 116, 0.3);
}

.btn-restart {
  background: linear-gradient(135deg, #3d2817 0%, #2a1f15 100%);
  color: var(--accent-gold);
  border: 1px solid rgba(200, 165, 116, 0.4);
}

.btn-restart:hover:not(:disabled) {
  background: linear-gradient(135deg, #4a3420 0%, #3a2f25 100%);
  box-shadow: 0 4px 12px rgba(200, 165, 116, 0.3);
}

.status {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 4px;
  background: rgba(45, 35, 25, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(200, 165, 116, 0.2);
  color: var(--accent-gold);
  letter-spacing: 0.8px;
  min-width: 200px;
}

.status.red {
  color: #c8956a;
}

.status.black {
  color: var(--accent-gold);
}

.status.win {
  color: #c8a574;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(45, 35, 25, 0.98) 0%, rgba(61, 40, 23, 0.98) 100%);
  box-shadow: 0 6px 20px rgba(200, 165, 116, 0.3);
}

.move-history {
  max-height: 280px;
  overflow-y: auto;
  background: rgba(45, 35, 25, 0.95);
  padding: 14px;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(200, 165, 116, 0.2);
  flex-grow: 1;
}

.move-history h3 {
  color: var(--accent-gold);
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(200, 165, 116, 0.3);
  padding-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.move-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(200, 165, 116, 0.1);
  font-size: 13px;
  color: rgba(245, 241, 235, 0.85);
  font-family: "Microsoft YaHei", monospace;
}

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

.move-history::-webkit-scrollbar {
  width: 6px;
}

.move-history::-webkit-scrollbar-track {
  background: rgba(200, 165, 116, 0.05);
  border-radius: 3px;
}

.move-history::-webkit-scrollbar-thumb {
  background: rgba(200, 165, 116, 0.3);
  border-radius: 3px;
}

.move-history::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 165, 116, 0.5);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .game-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .sidebar {
    min-width: auto;
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .board-container {
    padding: 15px;
  }

  canvas {
    transform: scale(0.9);
    transform-origin: top center;
  }

  button {
    padding: 10px 16px;
    font-size: 12px;
  }

  .sidebar {
    width: 100%;
    max-width: none;
  }
}
