/* ============================================================
   Chinese Chess - Game Styles
   ============================================================ */

:root {
  --red-color: #c0392b;
  --black-color: #2c3e50;
  --overlay-bg: rgba(0, 0, 0, 0.7);
}

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
}

/* ---- Common Buttons ---- */
.btn {
  padding: 12px 32px;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
}

/* ---- Overlay ---- */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.overlay-content {
  background: #fff;
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ---- Mode Selection ---- */
.game-title {
  font-size: 42px;
  margin-bottom: 4px;
  color: #333;
}

.subtitle {
  font-size: 16px;
  color: #888;
  margin-bottom: 32px;
}

.mode-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn-pvp {
  background: #333;
  color: #fff;
}

.btn-pve {
  background: #fff;
  color: #333;
  border: 2px solid #333;
}

/* ---- Rock Paper Scissors ---- */
#rps-section h2 {
  margin-bottom: 24px;
  color: #333;
}

.rps-player {
  margin-bottom: 20px;
}

.rps-player h3 {
  margin-bottom: 10px;
  font-size: 16px;
  color: #555;
}

.rps-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-rps {
  background: #fff;
  border: 2px solid #ccc;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 8px;
}

.btn-rps:hover {
  border-color: #333;
  background: #f5f5f5;
}

.btn-rps.selected {
  border-color: #ffd600;
  background: #fff9c4;
}

.rps-status {
  margin-top: 8px;
  font-size: 14px;
  color: #888;
}

.rps-result {
  margin-top: 16px;
  font-size: 18px;
  font-weight: bold;
  min-height: 28px;
}

/* ---- Game Area ---- */
#game-area {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
}

#game-main {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
}

/* ---- Status Bar ---- */
#status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
  margin-bottom: 16px;
  padding: 12px 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
}

.status-item {
  font-size: 15px;
}

.label {
  color: #777;
}

.team-indicator {
  font-weight: bold;
}

.text-red {
  color: var(--red-color);
}

.text-black-side {
  color: var(--black-color);
}

/* ---- Board ---- */
#board-canvas {
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  max-width: 100%;
  height: auto;
}

/* ---- Rules Panel ---- */
#rules-panel {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 220px;
  font-size: 13px;
  line-height: 1.6;
}

#rules-panel h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #333;
  border-bottom: 2px solid #8b6914;
  padding-bottom: 8px;
}

.rule-section {
  margin-bottom: 12px;
}

.rule-section h4 {
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}

.rule-section ul {
  list-style: none;
  padding-left: 4px;
}

.rule-section li {
  color: #666;
  padding: 1px 0;
}

/* ---- Message Area ---- */
#message {
  margin-top: 12px;
  padding: 10px 20px;
  font-size: 15px;
  color: #555;
  text-align: center;
  min-height: 40px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 480px;
}

#message.error {
  color: #e53935;
  background: rgba(229, 57, 53, 0.1);
}

#message.info {
  color: #1b5e20;
  background: rgba(76, 175, 80, 0.2);
}

/* ---- Game Over ---- */
#game-over .overlay-content h2 {
  font-size: 28px;
  margin-bottom: 24px;
}

.btn-restart {
  background: #333;
  color: #fff;
  font-size: 18px;
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
  .overlay-content {
    padding: 24px 16px;
  }

  .game-title {
    font-size: 32px;
  }

  .btn {
    padding: 10px 22px;
    font-size: 16px;
  }

  .mode-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .rps-buttons {
    flex-direction: column;
    align-items: center;
  }

  #game-main {
    flex-direction: column;
    align-items: center;
  }

  #rules-panel {
    width: 100%;
    max-width: 480px;
  }

  #status-bar {
    gap: 8px 16px;
    padding: 10px 12px;
  }

  .status-item {
    font-size: 13px;
  }
}
