/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

#app {
  width: 100%;
  min-height: 100vh;
  overflow: auto;
}

/* 屏幕切换 */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  overflow: auto;
}

.screen.active {
  display: flex;
}

/* 按钮样式 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

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

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

.btn-primary {
  background: #4CAF50;
  color: white;
}

.btn-primary:hover {
  background: #45a049;
}

.btn-secondary {
  background: #2196F3;
  color: white;
}

.btn-secondary:hover {
  background: #0b7dda;
}

.btn-large {
  padding: 15px 40px;
  font-size: 20px;
  font-weight: bold;
}

/* 设置界面 */
#setup-screen {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.setup-container {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.setup-container h1 {
  text-align: center;
  color: #667eea;
  font-size: 36px;
  margin-bottom: 10px;
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
}

.setup-form h2 {
  margin-bottom: 20px;
  color: #333;
}

/* 难度选择 */
.difficulty-section {
  margin-bottom: 30px;
}

.section-label {
  display: block;
  font-size: 16px;
  font-weight: bold;
  color: #555;
  margin-bottom: 15px;
}

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.difficulty-card {
  background: #f5f5f5;
  border: 3px solid #ddd;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.difficulty-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.difficulty-card.active {
  border-color: #667eea;
  background: #e8eaf6;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.difficulty-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.difficulty-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.difficulty-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 10px;
  min-height: 40px;
}

.difficulty-stats {
  font-size: 12px;
  color: #888;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.difficulty-stats div {
  margin: 3px 0;
}

.player-inputs {
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-group label {
  display: block;
  color: #555;
  min-width: 140px;
}

.input-group input[type="text"] {
  flex: 1;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  font-family: inherit;
}

.input-group input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
}

.ai-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  min-width: auto;
  white-space: nowrap;
}

.ai-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.ai-checkbox span {
  font-size: 14px;
  color: #667eea;
  font-weight: bold;
}

.setup-form .btn {
  width: 100%;
  margin-bottom: 10px;
}

.disclaimer {
  margin-top: 20px;
  padding: 10px;
  background: #fff3cd;
  border-radius: 5px;
  text-align: center;
  font-size: 14px;
  color: #856404;
}

/* 游戏主界面 */
#game-screen {
  padding: 20px;
  overflow: auto;
  box-sizing: border-box;
}

.game-container {
  display: flex;
  gap: 20px;
  min-height: calc(100vh - 40px);
  max-width: 1400px;
  margin: 0 auto;
  overflow: visible;
  align-items: flex-start;
  box-sizing: border-box;
}

.board-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
  width: 100%;
  max-width: 800px;
}

#game-board {
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  display: block;
  max-width: 100%;
  height: auto;
}

.dashboard-section {
  flex: 1;
  overflow-y: auto;
  min-width: 300px;
  max-height: calc(100vh - 40px);
}

.game-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.game-controls .btn {
  flex: 1;
  min-width: 120px;
}

/* 结束界面 */
#end-screen {
  justify-content: center;
  align-items: center;
}

.end-container {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  max-width: 600px;
  width: 90%;
  text-align: center;
}

.end-container h1 {
  color: #667eea;
  margin-bottom: 20px;
}

#end-content {
  margin: 30px 0;
  text-align: left;
}
