* { box-sizing: border-box; margin: 0; padding: 0; }
body, html { width: 100%; height: 100%; font-family: "Segoe UI", "Microsoft YaHei", sans-serif; background: #f2f5f9; color: #1f2937; }
.wrapper { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: #ffffff; border-bottom: 1px solid #dbe2ea;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.logo { font-size: 20px; font-weight: 700; color: #1f2937; }
.sub { color: #6b7a90; font-size: 13px; }
.github-link { color: #2563eb; text-decoration: none; font-size: 14px; }
.github-link:hover { text-decoration: underline; }

.layout { flex: 1; display: flex; gap: 0; min-height: 0; }
.menu-panel {
  width: 320px; overflow-y: auto; padding: 16px 18px;
  background: #ffffff; border-right: 1px solid #dbe2ea;
}
.menu-panel h2 { font-size: 17px; margin-bottom: 14px; color: #1f2937; }
.menu-panel h3 { font-size: 14px; margin: 16px 0 8px; color: #6b7a90; }
.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 13px; margin-bottom: 4px; color: #4b5b6e; }
.field input, .field select {
  width: 100%; padding: 7px 9px; border-radius: 6px;
  border: 1px solid #ccd6e0; background: #ffffff; color: #1f2937; font-size: 14px;
}
.switch-list { display: flex; flex-direction: column; gap: 6px; }
.switch-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: #f7f9fc; border: 1px solid #dbe2ea; border-radius: 6px; font-size: 13px;
}
.ai-player-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ai-type-select { margin-left: auto; max-width: 130px; padding: 4px 6px; border-radius: 6px; border: 1px solid #ccd6e0; background: #ffffff; color: #1f2937; }
.primary-btn {
  width: 100%; margin-top: 18px; padding: 12px; background: #2563eb; color: #fff;
  border: none; border-radius: 8px; font-size: 15px; cursor: pointer;
}
.primary-btn:hover { background: #3b7bf5; }
.error { color: #dc2626; font-size: 13px; margin-top: 10px; min-height: 1em; }

.game-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hud { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: #ffffff; border-bottom: 1px solid #dbe2ea; }
.hud button { padding: 7px 12px; border-radius: 6px; border: 1px solid #ccd6e0; background: #ffffff; color: #1f2937; cursor: pointer; }
.hud button:disabled { opacity: .4; cursor: not-allowed; }
.player-roster { display: flex; gap: 8px; flex-wrap: wrap; }
.player-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid #dbe2ea; background: #f7f9fc; font-size: 13px;
}
.player-chip.active {
  border-color: #2563eb; background: #eff5ff; font-weight: 600;
}
.player-dot {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block;
}
.anim-controls {
  display: flex; align-items: center; gap: 14px; padding: 8px 18px;
  background: #ffffff; border-bottom: 1px solid #dbe2ea;
}
.anim-controls .field { margin: 0; min-width: 150px; }
.anim-controls .switch-row { padding: 4px 8px; }
#scene-container { flex: 1; min-height: 0; position: relative; }
#status-text { font-size: 15px; color: #1f2937; }

.replay-bar { display: flex; gap: 8px; padding: 10px 18px; background: #ffffff; border-top: 1px solid #dbe2ea; }
.replay-bar button { padding: 7px 12px; border-radius: 6px; border: 1px solid #ccd6e0; background: #ffffff; color: #1f2937; cursor: pointer; }
.replay-bar button:disabled { opacity: .4; cursor: not-allowed; }

.footer { padding: 12px 20px; text-align: center; background: #ffffff; border-top: 1px solid #dbe2ea; font-size: 13px; }
.footer a { color: #2563eb; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.hidden { display: none !important; }
