    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      background: linear-gradient(145deg, #4a2c1a 0%, #6b4226 100%);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: 'Segoe UI', 'Microsoft YaHei', 'Noto Sans TC', sans-serif;
      padding: 20px;
    }
    .main-wrapper {
      display: flex;
      flex-direction: row;
      align-items: stretch;
      justify-content: center;
      gap: 20px;
      max-width: 1000px;
      width: 100%;
    }
    .cemetery-panel {
      background: rgba(45, 36, 22, 0.6);
      border: 2px solid #b4915c;
      border-radius: 24px;
      width: 110px;
      padding: 15px 10px;
      display: flex;
      flex-direction: column;
      align-items: center;
      box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
    }
    .cemetery-title {
      font-size: 0.9rem;
      color: #ffefc8;
      font-weight: bold;
      margin-bottom: 12px;
      text-align: center;
      border-bottom: 1px solid #b4915c;
      padding-bottom: 5px;
      width: 100%;
    }
    .cemetery-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      align-items: center;
      overflow-y: auto;
      flex-grow: 1;
      width: 100%;
    }
.stats-panel {
  margin-top: 20px;
  background: #FFFFFF;
  padding: 10px 20px;
  border-radius: 16px;
  border: 4px solid #5A3E1A; 
  box-shadow: 0 6px 0 #3A2810;
  text-align: center;
  z-index: 100;
  display: flex;
  gap: 30px;
  align-items: center;
  width: 100%;
  max-width: 500px;
  justify-content: space-around;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.0rem;
  color: #2D2216;
}

.stat-value {
  font-size: 1.2rem; 
  color: #B32424; 
}

.stat-label { 
  font-size: 1.0rem;
  color: #2D2216;
}

    .game-container {
      background: #deb887;
      background-image: radial-gradient(circle at 20% 20%, #f3e1c4, #b28b5e);
      border-radius: 48px;
      box-shadow: 0 30px 50px rgba(0, 0, 0, 0.6), inset 0 2px 8px rgba(255, 255, 200, 0.7);
      padding: 30px 30px 25px;
      display: flex;
      flex-direction: column;
      align-items: center;
      flex-grow: 1;
      border: 2px solid #5a3e1a;
    }
    h1 {
      font-size: 2.5rem;
      font-weight: 800;
      color: #fcf3e4;
      text-shadow: 4px 4px 0 #3e2b18, 6px 6px 0 rgba(0,0,0,0.3);
      margin-bottom: 20px;
      letter-spacing: 4px;
    }
    .board {
      display: grid;
      grid-template-columns: repeat(8, 1fr);
      grid-template-rows: repeat(4, 1fr);
      gap: 6px;
      background: #4b3621;
      padding: 15px;
      border-radius: 30px;
      box-shadow: inset 0 0 15px #1f1409, 0 20px 30px black;
      margin-bottom: 18px;
      border: 2px solid #b4915c;
    }
    .cell {
      width: 68px;
      height: 68px;
      background: radial-gradient(circle at 30% 30%, #fff6e5, #e7cfa1);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: 0.1s ease;
      box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), 0 4px 6px rgba(0,0,0,0.3);
    }
    .cell:active { transform: scale(0.94); }
    .piece {
      width: 82%;
      height: 82%;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.1rem;
      font-weight: 800;
      text-shadow: 2px 2px 3px rgba(0,0,0,0.8);
      box-shadow: 0 6px 10px rgba(0, 0, 0, 0.5), inset 0 -4px 4px rgba(0,0,0,0.4);
      background: #5a5a5a;
      color: #d4d4d4;
      border: 2px solid #f1e7c9;
      user-select: none;
    }
    .piece.back {
      background: radial-gradient(circle at 30% 30%, #6a6a6a, #1f1f1f);
      color: #b9b9b9;
      border: 2px solid #b39660;
      font-size: 2.3rem;
    }
    .piece.red {
      background: radial-gradient(circle at 35% 35%, #ff4d4d, #990000);
      color: white;
      border: 2px solid #ffcc00;
    }
    .piece.black {
      background: radial-gradient(circle at 35% 35%, #444444, #111111);
      color: white;
      border: 2px solid #e0e0e0;
    }
    .piece.dead {
      width: 40px;
      height: 40px;
      font-size: 1.3rem;
      box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }
    .selected {
      box-shadow: 0 0 0 5px #f9e076, 0 0 15px 5px #fabc3c;
      transform: scale(1.02);
    }
    .controls { margin-top: 10px; }
    button {
      background: #f3bc6c;
      border: none;
      color: #2e2412;
      font-weight: bold;
      font-size: 1.0rem;
      padding: 6px 12px;
      border-radius: 10px;
      cursor: pointer;
      box-shadow: 0 6px 0 #8b5e3c, 0 8px 18px black;
      transition: all 0.2s;
    }
    button:hover {
      background: #f5a34b;
      transform: translateY(-2px);
    }
    button:active {
      transform: translateY(4px);
      box-shadow: 0 2px 0 #8b5e3c, 0 4px 10px black;
    }
    button.leave-btn {
      background: #e74c3c;
      color: white;
      box-shadow: 0 6px 0 #c0392b, 0 8px 18px black;
      margin-left: 10px;
    }
    button.leave-btn:hover { background: #ff6b6b; }
    .message {
      font-size: 1.2rem;
      font-weight: bold;
      color: #ffefb2;
      background: #00000060;
      padding: 10px 24px;
      border-radius: 30px;
      margin-top: 15px;
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      text-align: center;
    }
    .game-over-overlay {
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0,0,0,0.85);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
    }
    .game-over-dialog {
      background: linear-gradient(135deg, #3a2214, #57341c);
      color: #ffd966;
      padding: 20px 30px;
      border-radius: 15px;
      text-align: center;
      box-shadow: 0 20px 50px rgba(0,0,0,0.8);
      border: 3px solid #b4915c;
      max-width: 70%;
      width: 350px;
    }
    .game-over-title {
      font-size: 1.5rem;
      font-weight: 700;
      margin-bottom: 15px;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    }
    .game-over-winner {
      font-size: 1.2rem;
      color: #fff;
      margin-bottom: 10px;
      background: rgba(0,0,0,0.3);
      padding: 5px;
      border-radius: 5px;
    }
    .dialog-btns {
      display: flex;
      justify-content: center;
      gap: 12px;
    }
    @media (max-width: 768px) {
      .main-wrapper { flex-direction: column; align-items: center; }
      .cemetery-panel { width: 100%; height: auto; flex-direction: row; padding: 10px; }
      .cemetery-title { width: auto; border-bottom: none; border-right: 1px solid #b4915c; padding-bottom: 0; padding-right: 10px; margin-bottom: 0; margin-right: 10px; }
      .cemetery-list { flex-direction: row; overflow-x: auto; justify-content: flex-start; }
      .cell { width: 35px; height: 35px; gap: 3px; }
      .piece { font-size: 1.1rem; }
    }
#fireworksCanvas {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  pointer-events: none; 
  z-index: 9999;
}

 .footer { text-align:center; padding:20px; color:var(--text-light); }
